home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Games #12
/
GEGA012.iso
/
Jogos de Azar
/
pokersuperstars.swf
/
scripts
/
frame_1
/
DoAction.as
< prev
Wrap
Text File
|
2006-01-17
|
142KB
|
4,996 lines
function initSplashScreen(logo)
{
createEmptyMovieClip("snd",99);
snd.loadMovie("Sounds.swf","GET");
snd._visible = false;
snd.tabIndex = 1;
snd.onLoad();
vol = 80;
volM = 50;
this.PlaySoundEffect = function(snd)
{
_root.snd.PlaySoundEffect(snd,vol);
};
this.PlayMusic = function(snd)
{
_root.snd.PlayMusic(snd,volM);
};
this.StopMusic = function(snd)
{
_root.snd.StopMusic();
};
this.SetMusicVolume = function()
{
_root.snd.SetMusicVolume(volM);
};
this.SetMusicVolume();
createEmptyMovieClip("preloader",5);
preloader.attachMovie("bkgdSplash","bkgdSplash",3);
preloader.bkgdSplash.btn_start._visible = false;
preloader.bkgdSplash.vsint._visible = false;
preloader.bkgdSplash.vs._visible = false;
if(_global.noZoneAPI == true)
{
preloader.bkgdSplash.zonelogo._visible = false;
preloader.bkgdSplash.zonelogo.gotoAndStop(1);
}
else
{
preloader.bkgdSplash.zonelogo._visible = true;
preloader.bkgdSplash.zonelogo.gotoAndStop(2);
}
preloader.bkgdSplash.btn_start.btn.onRelease = function()
{
_root.initMenu();
if(_global.noZoneAPI != true)
{
DoGameReady();
}
_root.preloader.removeMovieClip();
};
preloader.bkgdSplash.btn_start.btn.onPress = function()
{
this.PlaySoundEffect("SOUND_CLICK1");
};
preloader.createEmptyMovieClip("lgf",7);
preloader.lgf.loadMovie(logo);
preloader.lgf._x = 0 + logobufferx;
preloader.lgf._y = 0 + logobuffery;
preloader.lgf._yscale = 80;
preloader.lgf._xscale = 80;
}
function DoCustomEvent(event)
{
trace("DOWNLOADING NOW");
if(_global.download != null)
{
if(_global.downloadtype == "blank")
{
getURL(_global.download,"_blank");
}
else
{
getURL(_global.download,"");
}
return undefined;
}
eventhardcoded = "CustomEvent";
getURL("FSCommand:CustomEvent","<gamedata>" + eventhardcoded + "</gamedata>");
if(_root.gFake)
{
DoCustomReturn(null);
}
}
function DoCustomReturn(customData)
{
}
function DoGameBreak()
{
zoneBreaks++;
getURL("FSCommand:GameBreak","<data><breakpoint>" + zoneBreaks + "</breakpoint></data>");
numHandsPlayed++;
if(_root.gFake)
{
DoGameContinue(null);
}
}
function DoGameContinue(gameBreakData)
{
doLog("game continue: " + gameBreakData);
_root.getDealStandings();
}
function DoGameEnd()
{
DoScoreSubmit(zoneScore);
getUrl("FSCommand:GameEnd", "<gamedata></gamedata>");
}
function DoGameError()
{
}
function DoGameMenu()
{
}
function DoGameReady()
{
getUrl("FSCommand:GameReady", "<data><mode>round</mode><difficulty></difficulty><startlevel></startlevel></data>");
if(_root.gFake)
{
DoGameStart();
}
}
function DoGameStart()
{
if(gamestartrun)
{
PlayMusic("MUSIC_INTRO",_root.volM);
}
gamestartrun = true;
_root.gBreakId = 1;
_root.gGameStartTime = getTimer();
}
function DoScoreEvent(what, myscore)
{
var _loc2_ = int((getTimer() - _root.gGameStartTime) / 1000);
getURL("FSCommand:" add what,"<game><score>" + myscore + "</score><time>" + _loc2_ + "</time></game>");
}
function DoScoreBroadcast()
{
DoScoreEvent("ScoreBroadcast",zoneScore);
}
function DoScoreSubmit(fscore)
{
DoScoreEvent("ScoreSubmit",fscore);
}
function DoSessionReady()
{
getUrl("FSCommand:SessionReady", "<data></data>");
if(_root.gFake)
{
DoSessionStart();
}
}
function DoSessionStart()
{
preloader.bkgdSplash.btn_start._visible = true;
_root.PlaySoundEffect("SOUND_CHIP1");
_root.PlayMusic("MUSIC_INTRO",_root.volM);
}
function initLoader()
{
if(!loaded)
{
loaded = true;
isGameTimerActive = false;
maxHandsAllowed = 0;
_global.logo = "";
_global.shockwave = false;
_global.noZoneAPI = true;
_global.realmode = false;
_global.download = null;
_global.downloadType = "self";
zoneBreaks = 0;
blindincrement = 4;
_root.settings.load("pokerss.xml");
}
else
{
if(_global.noZoneAPI == true)
{
initSplashScreen(_global.logo);
}
else
{
initSplashScreen(_global.logo,true);
}
initSplashScreen();
}
}
function setEnterNameListener()
{
listenForEnter_obj = new Object();
listenForEnter_obj.onKeyDown = function()
{
if(Key.isDown(13) && this.pressedOnce == undefined)
{
if(gameMenu.active == "menu")
{
gameMenu.bkgdMenu.btn_play.btn.onRelease();
}
else if(gameMenu.active == "enterName")
{
gameMenu.bkgdEnterName.btn_okay.btn.onRelease();
}
this.pressedOnce = true;
}
};
listenForEnter_obj.onKeyUp = function()
{
this.pressedOnce = undefined;
};
Key.addListener(listenForEnter_obj);
}
function initMenu(defer, makenoise)
{
createEmptyMovieClip("gameMenu",_root.menudepth);
gameMenu.mydepth = 0;
gameMenu.active = "menu";
gameMenu.attachMovie("bkgdMenu","bkgdMenu",gameMenu.mydepth++);
gameMenu.buttonNames = new Array("howtoplay","options","quit","play","download","round","season","cashgame");
i = 0;
while(i < gameMenu.buttonNames.length)
{
gameMenu.bkgdMenu["btn_" + gameMenu.buttonNames[i]].btn.onRelease = function()
{
if(_root.gameMenu.active == "menu")
{
_root.menuButtons(this._parent.myname.text);
}
};
gameMenu.bkgdMenu["btn_" + gameMenu.buttonNames[i]].btn.onPress = function()
{
if(_root.gameMenu.active == "menu")
{
_root.buttonSound();
}
};
i++;
}
gameMenu.bkgdMenu.btn_round.radio.gotoAndStop(2);
gameMenu.bkgdMenu.playerCard.highlite.onRelease = function()
{
if(_root.gameMenu.active == "menu")
{
getUpsell();
}
};
gameMenu.bkgdMenu.playerCard.highlite.onPress = function()
{
if(_root.gameMenu.active == "menu")
{
_root.buttonSound();
}
};
if(_global.realmode == true)
{
gameMenu.bkgdMenu.btn_download._visible = false;
}
if(_global.shockwave)
{
gameMenu.bkgdMenu.vs._visible = true;
gameMenu.bkgdMenu.vsint._visible = true;
}
else
{
gameMenu.bkgdMenu.vsint._visible = false;
gameMenu.bkgdMenu.vs._visible = false;
}
PlaySoundEffect("SOUND_CHIP1");
if(!defer)
{
getEnterName();
}
else if(makenoise != "nosound")
{
PlayMusic("MUSIC_INTRO",_root.volM);
}
setEnterNameListener();
}
function menuButtons(myname)
{
myname = myname.toLowerCase();
switch(myname)
{
case "play":
mygame = new Game();
gameMenu.removeMovieClip();
break;
case "quit":
getUpsell("quit");
break;
case "how to play":
trace("getting help");
getHelp();
break;
case "options":
getOptions();
break;
case "round":
getUpsell();
break;
case "season":
getUpsell();
break;
case "download":
downloadAction();
break;
case "cash game":
getUpsell();
}
}
function getOptions()
{
gameMenu.attachMovie("bkgdOptions","bkgdOptions",gameMenu.mydepth++);
gameMenu.optionNames = new Array("okay","credits","switch");
i = 0;
while(i < gameMenu.optionNames.length)
{
gameMenu.bkgdOptions["btn_" + gameMenu.optionNames[i]].btn.onRelease = function()
{
if(gameMenu.active == "options")
{
_root.optionButtons(this._parent.myname.text);
}
};
gameMenu.bkgdOptions["btn_" + gameMenu.optionNames[i]].btn.onPress = function()
{
if(gameMenu.active == "options")
{
_root.buttonSound();
}
};
i++;
}
gameMenu.bkgdOptions.gamespeed.onPress = function()
{
if(gameMenu.active == "options")
{
_root.buttonSound();
_root.optionButtons("gamespeed");
}
};
gameMenu.active = "options";
gameMenu.bkgdOptions.tSnd._x = Math.round(273 + vol / 0.623);
gameMenu.bkgdOptions.tMusic._x = Math.round(273 + volM / 0.623);
}
function optionButtons(myname)
{
myname = myname.toLowerCase();
switch(myname)
{
case "okay":
gameMenu.active = "menu";
gameMenu.bkgdOptions.removeMovieClip();
break;
case "credits":
getCredits();
break;
case "switch":
getUpsell();
break;
case "gamespeed":
getUpsell();
}
}
function getCredits()
{
gameMenu.attachMovie("bkgdCredits","bkgdCredits",gameMenu.mydepth++);
gameMenu.bkgdCredits.btn_okay.btn.onRelease = function()
{
if(gameMenu.active == "credits")
{
_root.gameMenu.active = "options";
_root.gameMenu.bkgdCredits.removeMovieClip();
}
};
gameMenu.bkgdCredits.btn_okay.btn.onPress = function()
{
if(gameMenu.active == "credits")
{
_root.buttonSound();
}
};
gameMenu.active = "credits";
}
function getUpsell(type)
{
myActive = gameMenu.active;
gameMenu.attachMovie("bkgdUpsell","bkgdUpsell",gameMenu.mydepth++);
gameMenu.bkgdUpsell.btn_okay.btn.onRelease = function()
{
if(gameMenu.active == "upsell")
{
_root.gameMenu.active = _root.myActive;
_root.gameMenu.bkgdUpsell.removeMovieClip();
}
};
gameMenu.bkgdUpsell.btn_okay.btn.onPress = function()
{
if(gameMenu.active == "upsell")
{
_root.buttonSound();
}
};
gameMenu.bkgdUpsell.btn_download.btn.onRelease = function()
{
if(gameMenu.active == "upsell")
{
_root.downloadAction();
}
};
gameMenu.bkgdUpsell.btn_download.btn.onPress = function()
{
if(gameMenu.active == "upsell")
{
_root.buttonSound();
}
};
if(_global.realmode == true)
{
gameMenu.bkgdUpsell.btn_download._visible = false;
gameMenu.bkgdUpsell.btn_okay._x += 60;
}
gameMenu.active = "upsell";
}
function getEnterName(type)
{
gameMenu.attachMovie("bkgdEnterName","bkgdEnterName",gameMenu.mydepth++);
if(_root.username)
{
gameMenu.bkgdEnterName.username.text = _root.username;
}
gameMenu.bkgdEnterName.btn_okay.btn.onRelease = function()
{
if(gameMenu.active == "enterName")
{
if(this._parent._parent.username.text == "" || this._parent._parent.username.text == undefined)
{
_root.setName("Player");
}
else
{
_root.setName(this._parent._parent.username.text);
}
_root.gameMenu.active = "menu";
_root.gameMenu.bkgdEnterName.removeMovieClip();
}
};
gameMenu.bkgdEnterName.btn_okay.btn.onPress = function()
{
if(gameMenu.active == "enterName")
{
_root.buttonSound();
}
};
gameMenu.bkgdEnterName.btn_cancel.btn.onRelease = function()
{
if(gameMenu.active == "enterName")
{
if(this._parent._parent.username.text == "" || this._parent._parent.username.text == undefined)
{
_root.setName("Player");
}
_root.gameMenu.active = "menu";
_root.gameMenu.bkgdEnterName.removeMovieClip();
}
};
gameMenu.bkgdEnterName.btn_cancel.btn.onPress = function()
{
if(gameMenu.active == "enterName")
{
_root.buttonSound();
}
};
gameMenu.active = "enterName";
}
function getHelp()
{
loadMovieNum("howtoplay.swf",23,"GET");
}
function getTableHelp()
{
loadMovieNum("howtoplay.swf",23,"GET");
}
function setName(name)
{
_root.username = name;
if(_root.username)
{
gameMenu.bkgdMenu.playerCard.username.text = _root.username;
}
}
function buttonSound()
{
_root.PlaySoundEffect("SOUND_CLICK1");
}
function initTableMenu()
{
createEmptyMovieClip("tableMenu",_root.tablemenudepth);
tableMenu.mydepth = 0;
tableMenu.attachMovie("btn_pause","btn_pause",tableMenu.mydepth++);
tableMenu.btn_pause._x = 529;
tableMenu.btn_pause._y = 275.5;
if(_global.noZoneAPI == true)
{
tableMenu.btn_pause._visible = false;
}
tableMenu.attachMovie("btn_help","btn_help",tableMenu.mydepth++);
tableMenu.btn_help._x = 529;
tableMenu.btn_help._y = 350.5;
tableMenu.attachMovie("btn_options","btn_options",tableMenu.mydepth++);
tableMenu.btn_options._x = 529;
tableMenu.btn_options._y = 325.5;
tableMenu.attachMovie("btn_download","btn_download",tableMenu.mydepth++);
tableMenu.btn_download._x = 529;
tableMenu.btn_download._y = 300.5;
if(_global.realmode == true)
{
tableMenu.btn_download._visible = false;
}
tableMenu.attachMovie("btn_quit","btn_quit",tableMenu.mydepth++);
tableMenu.btn_quit._x = 529;
tableMenu.btn_quit._y = 375.5;
tableMenu.active = "menu";
tableMenu.buttonNames = new Array("options","help","download","quit","pause");
i = 0;
while(i < tableMenu.buttonNames.length)
{
tableMenu["btn_" + tableMenu.buttonNames[i]].btn.onRelease = function()
{
if(_root.tableMenu.active == "menu")
{
_root.tableMenuButtons(this._parent.myname.text);
}
};
tableMenu["btn_" + tableMenu.buttonNames[i]].btn.onPress = function()
{
if(_root.tableMenu.active == "menu")
{
_root.buttonSound();
}
};
i++;
}
}
function tableMenuButtons(myname)
{
myname = myname.toLowerCase();
switch(myname)
{
case "help":
getTableHelp();
break;
case "pause":
gamePause();
break;
case "get tip":
getTableUpsell("quit");
break;
case "options":
getTableOptions();
break;
case "download":
_root.downloadAction();
break;
case "quit":
getTableQuit();
}
}
function getTableQuit()
{
tableMenu.attachMovie("bkgdQuit","bkgdQuit",tableMenu.mydepth++);
tableMenu.bkgdQuit.btn_yes.btn.onRelease = function()
{
if(tableMenu.active == "quit")
{
killTheGame("defer");
}
};
tableMenu.bkgdQuit.btn_no.btn.onRelease = function()
{
if(tableMenu.active == "quit")
{
tableMenu.active = "menu";
tableMenu.bkgdQuit.removeMovieClip();
}
};
tableMenu.bkgdQuit.btn_yes.btn.onPress = function()
{
if(tableMenu.active == "quit")
{
_root.buttonSound();
}
};
tableMenu.bkgdQuit.btn_no.btn.onPress = function()
{
if(tableMenu.active == "quit")
{
_root.buttonSound();
}
};
tableMenu.active = "quit";
}
function getTableOptions()
{
tableMenu.attachMovie("bkgdOptions","bkgdOptions",tableMenu.mydepth++);
tableMenu.optionNames = new Array("okay","credits","switch");
i = 0;
while(i < tableMenu.optionNames.length)
{
tableMenu.bkgdOptions["btn_" + tableMenu.optionNames[i]].btn.onRelease = function()
{
trace("this._parent.myname.text");
if(tableMenu.active == "options")
{
_root.tableOptionButtons(this._parent.myname.text);
}
};
tableMenu.bkgdOptions["btn_" + tableMenu.optionNames[i]].btn.onPress = function()
{
if(tableMenu.active == "options")
{
_root.buttonSound();
}
};
i++;
}
tableMenu.bkgdOptions.gamespeed.onPress = function()
{
if(tableMenu.active == "options")
{
_root.buttonSound();
_root.tableOptionButtons("gamespeed");
}
};
tableMenu.active = "options";
tableMenu.bkgdOptions.tSnd._x = Math.round(273 + vol / 0.623);
tableMenu.bkgdOptions.tMusic._x = Math.round(273 + volM / 0.623);
}
function tableOptionButtons(myname)
{
myname = myname.toLowerCase();
switch(myname)
{
case "okay":
tableMenu.active = "menu";
tableMenu.bkgdOptions.removeMovieClip();
break;
case "credits":
getTableCredits();
break;
case "switch":
getTableUpsell();
break;
case "gamespeed":
getTableUpsell();
}
}
function getTableCredits()
{
tableMenu.attachMovie("bkgdCredits","bkgdCredits",tableMenu.mydepth++);
tableMenu.bkgdCredits.btn_okay.btn.onRelease = function()
{
if(tableMenu.active == "credits")
{
_root.tableMenu.active = "options";
_root.tableMenu.bkgdCredits.removeMovieClip();
}
};
tableMenu.bkgdCredits.btn_okay.btn.onPress = function()
{
if(tableMenu.active == "credits")
{
_root.buttonSound();
}
};
tableMenu.active = "credits";
}
function getTableUpsell(type)
{
myActive = tableMenu.active;
tableMenu.attachMovie("bkgdUpsell","bkgdUpsell",tableMenu.mydepth++);
tableMenu.bkgdUpsell.btn_okay.btn.onRelease = function()
{
if(tableMenu.active == "upsell")
{
_root.tableMenu.active = _root.myActive;
_root.tableMenu.bkgdUpsell.removeMovieClip();
}
};
tableMenu.bkgdUpsell.btn_okay.btn.onPress = function()
{
if(tableMenu.active == "upsell")
{
_root.buttonSound();
}
};
tableMenu.bkgdUpsell.btn_download.btn.onRelease = function()
{
if(tableMenu.active == "upsell")
{
_root.downloadAction();
}
};
if(_global.realmode == true)
{
tableMenu.bkgdUpsell.btn_download._visible = false;
tableMenu.bkgdUpsell.btn_okay._x = 260;
}
tableMenu.bkgdUpsell.btn_download.btn.onPress = function()
{
if(tableMenu.active == "upsell")
{
_root.buttonSound();
}
};
tableMenu.active = "upsell";
}
function downloadAction()
{
trace("GOT TO DOWNLOAD BUTTON");
_root.DoCustomEvent("download");
}
function Bubble()
{
createEmptyMovieClip("bubbles",_root.bubbledepth);
this.mydepth = 0;
}
function processHand(who)
{
var _loc6_ = undefined;
_loc6_ = 0;
while(_loc6_ < 8)
{
this["x" + _loc6_] = null;
_loc6_ = _loc6_ + 1;
}
this["bestHand" + who] = new Array();
cAr = new Array();
x1 = arena["card_" + who + "_0"].mycard;
x2 = arena["card_" + who + "_1"].mycard;
_loc6_ = 0;
while(_loc6_ < 5)
{
this["x" + (_loc6_ + 3)] = arena["card_comm_" + _loc6_].mycard;
_loc6_ = _loc6_ + 1;
}
if(x3 == null || x3 == undefined)
{
hh1 = x1;
hh2 = x2;
divider = 0;
_loc6_ = 1;
while(_loc6_ < 3)
{
if(this["hh" + _loc6_] > 13 && this["hh" + _loc6_] < 27)
{
divider = 13;
}
else if(this["hh" + _loc6_] > 26 && this["hh" + _loc6_] < 40)
{
divider = 26;
}
else if(this["hh" + _loc6_] > 39)
{
divider = 39;
}
this["hh" + _loc6_] -= divider;
_loc6_ = _loc6_ + 1;
}
if(hh1 == 1)
{
hh1 = 14;
}
if(hh2 == 1)
{
hh2 = 14;
}
if(hh1 == hh2)
{
playerHand = 1;
thisPair0 = hh1;
}
else
{
playerHand = 0;
}
bestHand = new Array();
bestHand.push(playerHand);
hc = hh1;
if(playerHand == 0)
{
if(hh1 > hh2)
{
bestHand.push(hh1);
bestHand.push(hh2);
}
else
{
bestHand.push(hh2);
bestHand.push(hh1);
hc = hh2;
}
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = "HIGH CARD - " + dval;
}
if(playerHand == 1 || playerhand == 0 && pairNum0 > 0)
{
bestHand.push(thisPair0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = "Pair of " + dval + "\'s";
hc = hh1;
}
aString = "";
gg = 0;
while(gg < bestHand.length)
{
if(bestHand[gg].toString().substring(0,2).length == 1 && gg > 0)
{
aString += "0" + bestHand[gg];
}
else
{
aString += bestHand[gg].toString();
}
gg++;
}
aNumber = Number(aString);
pos = new Array();
if(hc == hh1)
{
pos.push({loc:0,card:hh1});
pos.push({loc:1,card:hh2});
}
else
{
pos.push({loc:1,card:hh2});
pos.push({loc:0,card:hh1});
}
this["bestHand" + who].push({h:bestHand,t:handText,a:aNumber,p:pos,hc:hc,pair0:thisPair0,pair1:0});
trace("--besthand " + bestHand);
trace("--handtext " + handText);
trace("--anumber " + aNumber);
}
else
{
_loc6_ = 0;
while(_loc6_ < 8)
{
if(this["x" + _loc6_] != undefined && this["x" + _loc6_] != null)
{
cAr.push(this["x" + _loc6_]);
}
_loc6_ = _loc6_ + 1;
}
var aString = "";
var gg = 0;
var _loc17_ = 0;
var _loc7_ = 0;
var _loc5_ = 0;
var _loc4_ = 0;
var _loc2_ = 0;
var _loc3_ = 0;
_loc7_ = 0;
while(_loc7_ < cAr.length - 4)
{
_loc5_ = _loc7_ + 1;
while(_loc5_ < cAr.length - 3)
{
_loc4_ = _loc5_ + 1;
while(_loc4_ < cAr.length - 2)
{
_loc2_ = _loc4_ + 1;
while(_loc2_ < cAr.length - 1)
{
_loc3_ = _loc2_ + 1;
while(_loc3_ < cAr.length)
{
hAr = new Array(cAr[_loc7_],cAr[_loc5_],cAr[_loc4_],cAr[_loc2_],cAr[_loc3_]);
scoreHand(hAr);
aString = "";
gg = 0;
while(gg < bestHand.length)
{
if(bestHand[gg].toString().substring(0,2).length == 1 && gg > 0)
{
aString += "0" + bestHand[gg];
}
else
{
aString += bestHand[gg].toString();
}
gg++;
}
if(aString.substring(0,1) == 0)
{
aString = aString.substring(1,aString.length);
}
aNumber = Number(aString);
pos = new Array();
pos.push({loc:_loc7_,card:cAr[_loc7_]});
pos.push({loc:_loc5_,card:cAr[_loc5_]});
pos.push({loc:_loc4_,card:cAr[_loc4_]});
pos.push({loc:_loc2_,card:cAr[_loc2_]});
pos.push({loc:_loc3_,card:cAr[_loc3_]});
this["bestHand" + who].push({h:bestHand,t:handText,a:aNumber,p:pos,hc:hc,pair0:thisPair0,pair1:thisPair1});
_loc17_ = _loc17_ + 1;
_loc3_ = _loc3_ + 1;
}
_loc2_ = _loc2_ + 1;
}
_loc4_ = _loc4_ + 1;
}
_loc5_ = _loc5_ + 1;
}
_loc7_ = _loc7_ + 1;
}
this["bestHand" + who].sortOn("a",18);
trace("-----FINAL HAND " + who + " -----");
trace("h - " + this["bestHand" + who][0].h);
trace("a - " + this["bestHand" + who][0].a);
trace("");
}
}
function highlightWinningCards(who, where)
{
var _loc2_ = undefined;
if(!who)
{
who = 0;
}
var _loc3_ = new Array();
var _loc5_ = new Array();
var _loc10_ = _root["bestHand" + who][0].h[0];
var _loc6_ = _root["bestHand" + who][0].hc;
var _loc8_ = _root["bestHand" + who][0].pair0;
var _loc9_ = _root["bestHand" + who][0].pair1;
var _loc4_ = _root["bestHand" + who][0].p;
if(_loc10_ == 0)
{
_loc2_ = 0;
while(_loc2_ < _loc4_.length)
{
tmpcard = getDivider(_loc4_[_loc2_].card);
tmploc = _loc4_[_loc2_].loc;
if(tmpcard == _loc6_)
{
_loc3_.push(tmploc);
break;
}
_loc2_ = _loc2_ + 1;
}
}
if(_loc10_ == 1)
{
_loc2_ = 0;
while(_loc2_ < _loc4_.length)
{
tmpcard = getDivider(_loc4_[_loc2_].card);
tmploc = _loc4_[_loc2_].loc;
if(tmpcard == _loc8_)
{
_loc3_.push(tmploc);
}
if(tmpcard == _loc6_)
{
_loc5_.push(tmploc);
}
_loc2_ = _loc2_ + 1;
}
}
if(_loc10_ == 2)
{
_loc2_ = 0;
while(_loc2_ < _loc4_.length)
{
tmpcard = getDivider(_loc4_[_loc2_].card);
tmploc = _loc4_[_loc2_].loc;
if(tmpcard == _loc8_ || tmpcard == _loc9_)
{
_loc3_.push(tmploc);
}
if(tmpcard == _loc6_)
{
_loc5_.push(tmploc);
}
_loc2_ = _loc2_ + 1;
}
}
if(_loc10_ == 3)
{
_loc2_ = 0;
while(_loc2_ < _loc4_.length)
{
tmpcard = getDivider(_loc4_[_loc2_].card);
tmploc = _loc4_[_loc2_].loc;
if(tmpcard == _loc8_)
{
_loc3_.push(tmploc);
}
if(tmpcard == _loc6_)
{
_loc5_.push(tmploc);
}
_loc2_ = _loc2_ + 1;
}
}
if(_loc10_ == 6)
{
_loc2_ = 0;
while(_loc2_ < _loc4_.length)
{
tmpcard = getDivider(_loc4_[_loc2_].card);
tmploc = _loc4_[_loc2_].loc;
if(tmpcard == _loc8_ || tmpcard == _loc9_)
{
_loc3_.push(tmploc);
}
if(tmpcard == _loc6_)
{
_loc5_.push(tmploc);
}
_loc2_ = _loc2_ + 1;
}
}
if(_loc10_ == 7)
{
_loc2_ = 0;
while(_loc2_ < _loc4_.length)
{
tmpcard = getDivider(_loc4_[_loc2_].card);
tmploc = _loc4_[_loc2_].loc;
if(tmpcard == _loc8_)
{
_loc3_.push(tmploc);
}
if(tmpcard == _loc6_)
{
_loc5_.push(tmploc);
}
_loc2_ = _loc2_ + 1;
}
}
if(_loc10_ == 4 || _loc10_ == 5 || _loc10_ == 8 || _loc10_ == 9)
{
_loc2_ = 0;
while(_loc2_ < _loc4_.length)
{
tmploc = _loc4_[_loc2_].loc;
_loc3_.push(tmploc);
_loc2_ = _loc2_ + 1;
}
}
k = 0;
while(k < mygame.myhand.handPlayers.length)
{
_loc2_ = 0;
while(_loc2_ < 3)
{
arena["card_" + mygame.myhand.handPlayers[k] + "_" + _loc2_].cardback._visible = true;
arena["card_" + mygame.myhand.handPlayers[k] + "_" + _loc2_].cardback.gotoAndStop(4);
_loc2_ = _loc2_ + 1;
}
k++;
}
if(!where)
{
if(_loc5_[0] == 0 || _loc5_[0] == 1)
{
arena["card_" + who + "_" + _loc5_[0]].cardback.gotoAndStop(3);
}
else
{
arena["card_comm_" + (_loc5_[0] - 2)].cardback.gotoAndStop(3);
}
_loc2_ = 0;
while(_loc2_ < _loc3_.length)
{
if(_loc3_[_loc2_] == 0 || _loc3_[_loc2_] == 1)
{
arena["card_" + who + "_" + _loc3_[_loc2_]].cardback._visible = true;
arena["card_" + who + "_" + _loc3_[_loc2_]].cardback.gotoAndStop(2);
}
else
{
arena["card_comm_" + (_loc3_[_loc2_] - 2)].cardback._visible = true;
arena["card_comm_" + (_loc3_[_loc2_] - 2)].cardback.gotoAndStop(2);
}
_loc2_ = _loc2_ + 1;
}
}
else
{
if(_loc5_[0] == 0 || _loc5_[0] == 1)
{
allin["card_" + who + "_" + _loc5_[0]].cardback.gotoAndStop(3);
}
else
{
allin["card_comm_" + (_loc5_[0] - 2)].cardback.gotoAndStop(3);
}
_loc2_ = 0;
while(_loc2_ < _loc3_.length)
{
if(_loc3_[_loc2_] == 0 || _loc3_[_loc2_] == 1)
{
allin["card_" + who + "_" + _loc3_[_loc2_]].cardback._visible = true;
allin["card_" + who + "_" + _loc3_[_loc2_]].cardback.gotoAndStop(2);
}
else
{
allin["card_comm_" + (_loc3_[_loc2_] - 2)].cardback._visible = true;
allin["card_comm_" + (_loc3_[_loc2_] - 2)].cardback.gotoAndStop(2);
}
_loc2_ = _loc2_ + 1;
}
}
}
function getDivider(c)
{
divider = 0;
if(c > 13 && c < 27)
{
divider = 13;
}
else if(c > 26 && c < 40)
{
divider = 26;
}
else if(c > 39)
{
divider = 39;
}
c -= divider;
if(c == 1)
{
c = 14;
}
return c;
}
function shockMe(type, gamescore)
{
myshock = new ShockwaveHubDialog(type,gamescore);
myshock.Init();
}
function ShockwaveHubDialog(type, gamescore)
{
this.fName = "ShockwaveHubDialog";
this.fDefaultButton = null;
this.fObj = obj;
this.fCallback = callback;
this.fInterval = null;
this.fbDidUnload = false;
this.fStart = getTimer();
var _loc2_ = new Object();
_loc2_.showTab = type;
_loc2_.gameId = "pokersuperstarsweb";
_loc2_.gameTitle = "Poker Superstars Single Round";
_loc2_.screenWidth = 600;
_loc2_.screenHeight = 400;
_loc2_.scoreDescriptor = "Power Rank";
_loc2_.numPlayers = 1;
_loc2_.player1Score = gamescore;
_loc2_.player2Score = 0;
_loc2_.player3Score = 0;
_loc2_.player4Score = 0;
_level0.swHighScoreObject = _loc2_;
_level0.playAgain = function()
{
arena.standings.sscover.gotoAndStop(2);
arena.standings.powerranking = 0;
};
System.security.allowDomain("gameblast.shockwave.com","www.shockwave.com","dev.shockwave.com","staging.shockwave.com");
}
function gamePause()
{
if(pauseOn == false && _global.noZoneAPI == false)
{
pauseOn = true;
voltemp = vol;
vol = 0;
snd.onMute(true);
createEmptyMovieClip("stopGo",_root.pausedepth);
stopGo.attachMovie("bkgdPause","bkgdPause",2);
stopGo.bkgdPause.btn_resume.btn.onRelease = function()
{
gamePauseOff();
};
stopGo.bkgdPause.btn_resume.btn.onPress = function()
{
_root.buttonSound();
};
baseTime = getTimer();
pauseInterval = setInterval(calcZoneTime,100);
}
}
function gamePauseOff()
{
if(pauseOn == true)
{
pauseOn = false;
vol = voltemp;
snd.onMute(false);
gGameStartTime += newtime;
clearInterval(pauseInterval);
if(pauseReturnAction != "" && pauseReturnAction != undefined)
{
mygame.myhand[pauseReturnAction]();
}
pauseReturnAction = "";
stopGo.removeMovieClip();
}
}
function calcZoneTime()
{
newtime = getTimer() - baseTime;
}
function loadAI()
{
loadMovieNum("AIapp_final.swf",22,"GET");
}
function unloadAI()
{
unloadMovieNum(22);
}
function getBetLevel()
{
ante = prePay[betLevel][2];
bigblind = prePay[betLevel][0];
smallblind = prePay[betLevel][1];
minRaise = bigblind;
mygame.ante = ante;
mygame.smallblind = smallblind;
mygame.bigblind = bigblind;
}
function Game()
{
if(isGameTimerActive == true)
{
gameStartTime = getTimer();
}
Key.removeListener(listenForEnter_obj);
botsDoAll = false;
betLevel = 0;
getBetLevel();
this.ante = _root.ante;
this.bigblind = _root.bigblind;
this.smallblind = _root.smallblind;
this.mybubble = new Bubble();
this.mydepth = 0;
this.defaultBalance = 100000;
this.isNew = true;
numHandsPlayedX = 0;
numHandsPlayed = 0;
nhrecord = 0;
trace("TIMER ON? " + isGameTimerActive);
this.finalrank = new Array("4th Place","3rd Place","2nd Place","Winner");
createEmptyMovieClip("table",_root.tabledepth);
table.attachMovie("bkgdTable","bkgdTable",this.mydepth++);
initTableMenu();
this.elimPlayers = new Array();
this.currentPlayers = new Array(0,1,2,3,4);
if(maxplayers < 5)
{
this.currentPlayers[2] = "e";
}
t = new Array(0,1,2,4,5,6,7,8);
t.shuffle();
this.gPlayers = new Object();
this.gPlayers.player3 = {first:_root.username,last:"",lTag:"THE FUTURE OF POKER?"};
this.gPlayers["player" + t[0]] = {first:"Barry",last:"Greenstein",lTag:"MOST SUCCESSFUL CASH PLAYER OF DECADE"};
this.gPlayers["player" + t[1]] = {first:"Chip",last:"Reese",lTag:"YOUNGEST INDUCTEE POKER HALL OF FAME"};
this.gPlayers["player" + t[2]] = {first:"Doyle",last:"Brunson",lTag:"NINE W.S.O.P TITLES"};
this.gPlayers["player" + t[3]] = {first:"Gus",last:"Hansen",lTag:"3 MAJOR TOURNAMENT WINS IN 10 MONTHS"};
this.gPlayers["player" + t[4]] = {first:"Howard",last:"Lederer",lTag:"2 MAJOR TOURNAMENT WINS 2004"};
this.gPlayers["player" + t[5]] = {first:"Johnny",last:"Chan",lTag:"BACK TO BACK WORLD CHAMPIONSHIPS"};
this.gPlayers["player" + t[6]] = {first:"Phil",last:"Ivey",lTag:"3 W.S.O.P TITLES IN 2002"};
this.gPlayers["player" + t[7]] = {first:"TJ",last:"Cloutier",lTag:"MOST MAJOR TOURNAMENT WINS EVER"};
this.gPbox = new Object();
if(maxplayers == 5)
{
this.gPbox.b0 = {x:-6.7,y:-7.3,chipx:4,chipy:113,dbx:102,dby:7.2,cx:99,cy:46,bsx:128.3,bsy:94,blx:128.3,bly:83};
this.gPbox.b1 = {x:431.8,y:-4.3,chipx:350.3,chipy:7.2,dbx:536,dby:29,cx:377,cy:84,bsx:296.6,bsy:37.5,blx:286.6,bly:26.6};
this.gPbox.b2 = {x:493,y:121.8,chipx:505.6,chipy:238.4,dbx:567,dby:93,cx:440,cy:142,bsx:483.7,bsy:92.9,blx:473.7,bly:81.9};
this.gPbox.b3 = {x:384.8,y:282.4,chipx:393,chipy:218.2,dbx:490,dby:353,cx:330,cy:290,bsx:0,bsy:0,blx:442.4,bly:169};
this.gPbox.b4 = {x:3.4,y:283.4,chipx:14,chipy:220,dbx:109,dby:356,cx:107,cy:279,bsx:0,bsy:0,blx:0,bly:0};
}
else
{
this.gPbox.b0 = {x:11.4,y:-5.8,chipx:22,chipy:113,dbx:116,dby:94,cx:117,cy:21,bsx:-2.7,bsy:101,blx:-12.7,bly:101};
this.gPbox.b1 = {x:475.8,y:-5.8,chipx:489,chipy:113,dbx:448,dby:94,cx:421,cy:21,bsx:461,bsy:101,blx:451,bly:101};
this.gPbox.b2 = {x:493,y:121.8,chipx:505.6,chipy:238.4,dbx:567,dby:93,cx:440,cy:142,bsx:483.7,bsy:92.9,blx:473.7,bly:81.9};
this.gPbox.b3 = {x:434.8,y:283.4,chipx:443,chipy:220,dbx:406,dby:273.6,cx:380,cy:310,bsx:420,bsy:230,blx:410,bly:210};
this.gPbox.b4 = {x:11.4,y:283.4,chipx:22,chipy:220,dbx:116,dby:273.6,cx:117,cy:310,bsx:-2.7,bsy:230,blx:-12.7,bly:210};
}
this.gChip = new Object();
this.gChip.inc = 1;
this.gChip.oflow = 15;
this.gChip.defaultChips = {c100:10,c500:10,c1000:24,c5000:14,c25000:0};
this.gChip.chip0 = {x:0,y:0};
this.gChip.chip1 = {x:30,y:0};
this.gChip.chip2 = {x:60,y:0};
this.gChip.chip3 = {x:0,y:28};
this.gChip.chip4 = {x:30,y:28};
this.gChip.chip5 = {x:60,y:28};
var _loc3_ = 0;
while(_loc3_ < 5)
{
this.gChip["chip" + _loc3_].c100 = 10;
this.gChip["chip" + _loc3_].c500 = 10;
this.gChip["chip" + _loc3_].c1000 = 24;
this.gChip["chip" + _loc3_].c5000 = 14;
this.gChip["chip" + _loc3_].c25000 = 0;
_loc3_ = _loc3_ + 1;
}
this.gChip.chipD = {x:226,y:93};
this.gChip.chipD.c100 = 0;
this.gChip.chipD.c500 = 0;
this.gChip.chipD.c1000 = 0;
this.gChip.chipD.c5000 = 0;
this.gChip.chipD.c25000 = 0;
this.gChip.mchip0 = {x:0,y:0};
this.gChip.mchip1 = {x:30,y:0};
this.gChip.mchip2 = {x:60,y:0};
this.gChip.mchip3 = {x:90,y:0};
this.gChip.mchip4 = {x:120,y:0};
this.gChip.mchip5 = {x:0,y:30};
this.gChip.mchip6 = {x:30,y:30};
this.gChip.mchip7 = {x:60,y:30};
this.gChip.mchip8 = {x:90,y:30};
this.gChip.mchip9 = {x:120,y:30};
this.gChip.chipBet = {x:334.6,y:235.7};
this.gChip.chipBet.c100 = 0;
this.gChip.chipBet.c500 = 0;
this.gChip.chipBet.c1000 = 0;
this.gChip.chipBet.c5000 = 0;
this.gChip.chipBet.c25000 = 0;
this.gChip.bchip0 = {x:0,y:0};
this.gChip.bchip1 = {x:30,y:0};
this.gChip.bchip2 = {x:15,y:25};
this.gChip.bchip3 = {x:60,y:0};
this.gChip.bchip4 = {x:45,y:25};
this.gChip.bchip5 = {x:75,y:25};
this.gBubble = new Object();
if(maxplayers == 5)
{
this.gBubble.b0 = {sx:61.8,sy:69,lx:61.8,ly:58,tri:1};
this.gBubble.b1 = {sx:417.2,sy:67.9,lx:407.2,ly:56.9,tri:1};
this.gBubble.b2 = {sx:396,sy:155,lx:375,ly:144,tri:2};
this.gBubble.b3 = {sx:250,sy:315,lx:230,ly:304,tri:3};
this.gBubble.b4 = {sx:30,sy:232,lx:20,ly:212,tri:3};
}
else
{
this.gBubble.b0 = {sx:-2.7,sy:101,lx:-12.7,ly:101,tri:1};
this.gBubble.b1 = {sx:461,sy:101,lx:451,ly:101,tri:1};
this.gBubble.b3 = {sx:420,sy:230,lx:410,ly:210,tri:3};
this.gBubble.b4 = {sx:-2.7,sy:230,lx:-12.7,ly:210,tri:3};
}
this.gBubble.b5 = {sx:230,sy:12.6,lx:220,ly:1.6,tri:1};
this.gBubble.b6 = {sx:230,sy:12.6,lx:220,ly:1.6,tri:1};
this.gBubble.b10 = {sx:230,sy:320.6,lx:230,ly:320.6,tri:3};
this.gBubble.bspecial = {specialx:207.5,specialy:332.8,lx:0,ly:0,tri:0};
var _loc4_ = new Array();
_loc3_ = 0;
while(_loc3_ < this.currentPlayers.length)
{
if(this.currentPlayers[_loc3_] != "e")
{
_loc4_.push(_loc3_);
}
_loc3_ = _loc3_ + 1;
}
_loc4_.shuffle();
table.attachMovie("dealercontrol","dealerButton",this.mydepth++);
this.dealer = _loc4_[0];
trace("DEALER #1 = " + this.dealer);
this.placeDealerButton(this.currentPlayers[this.dealer]);
table.dealerButton._visible = false;
this.introDialog();
}
function sortChips()
{
p.sortOn("amt",18);
}
function getStacks(maxOflow)
{
if(!maxOflow)
{
maxOflow = 1;
}
checkAgain = false;
numStacks = 1;
numOflow = 0;
var _loc1_ = 0;
while(_loc1_ < 5)
{
if(p[_loc1_].amt > 0)
{
numStacks++;
}
_loc1_ = _loc1_ + 1;
}
_loc1_ = 0;
while(_loc1_ < 5)
{
if(p[_loc1_].amt > oflow)
{
if(numStacks >= 6)
{
numOflow++;
}
else
{
numStacks++;
}
}
_loc1_ = _loc1_ + 1;
}
if(numOflow >= maxOflow)
{
_loc1_ = 3;
while(_loc1_ > -1)
{
if(p[_loc1_].amt > oflow)
{
convertChip(_loc1_);
numOflow = 0;
checkAgain = true;
break;
}
_loc1_ = _loc1_ - 1;
}
}
}
function convertChip(chip)
{
numToGrab = p[chip].amt - oflow;
if(numToGrab <= p[chip].tonext)
{
numToGrab = p[chip].tonext;
}
else
{
ok = false;
while(ok == false)
{
var _loc2_ = numToGrab / p[chip].tonext;
var _loc1_ = Math.round(numToGrab / p[chip].tonext);
if(_loc2_ != _loc1_)
{
numToGrab++;
}
else
{
ok = true;
}
}
}
p[chip].amt -= numToGrab;
p[chip + 1].amt += numToGrab / p[chip].tonext;
}
function TheHand(ds, hp, firsthand)
{
if(!nhrecord)
{
nhrecord = 1;
}
else
{
nhrecord++;
}
if(nhrecord == blindincrement || nhrecord == blindincrement * 2 || nhrecord == blindincrement * 3 || nhrecord == blindincrement * 4 || nhrecord == blindincrement * 5 || nhrecord == blindincrement * 6 || nhrecord == blindincrement * 7 || nhrecord == blindincrement * 8 || nhrecord == blindincrement * 9)
{
betLevel++;
getBetLevel();
}
if(!ntrecord)
{
ntrecord = getTimer();
}
if(nhrecord == 1)
{
DoScoreBroadcast();
}
var _loc3_ = undefined;
yup = false;
if(!xtraPot)
{
xtraPot = 0;
}
this.basicPot = xtraPot;
this.potStore = new Array(0,0,0,0,0);
this.AllInPool = new Array(0,0,0,0,0);
this.currentpot = 0;
this.dealerSlot = ds;
this.handPlayers = new Array();
_loc3_ = 0;
while(_loc3_ < hp.length)
{
this.handPlayers[_loc3_] = hp[_loc3_];
table["chipBox" + _loc3_].enchilada = 0;
table["chipBox" + _loc3_].mybet = 0;
table["pBox" + _loc3_].mybet = 0;
_loc3_ = _loc3_ + 1;
}
trace(this.handPlayers);
trace("Starting a new hand!");
this.mydepth = 0;
this.dealType = new Array("flop","turn","river","end");
this.cardOffsetX = 10;
this.cardOffsetY = 3;
this.betStop = this.dealerSlot;
this.betStart = this.returnNextPlayer(this.handPlayers[this.dealerSlot]);
this.currentBet = 0;
this.commcardcount = 0;
this.AllInActive = 0;
this.numBettors = 0;
this.numRaises = 0;
createEmptyMovieClip("arena",_root.rounddepth);
this.makePot();
if(firsthand)
{
arena.attachMovie("btn_deal","btn_deal",this.mydepth++);
if(maxplayers == 5)
{
arena.btn_deal._x = 255;
arena.btn_deal._y = 245;
}
else
{
arena.btn_deal._x = 255;
arena.btn_deal._y = 255;
}
arena.btn_deal.btn.onRelease = function()
{
dly = 17.7;
PlayMusic("MUSIC_INTRO",_root.volM);
table.dealerButton._visible = true;
_root.mygame.myhand.postAnte();
arena.btn_standings.removeMovieClip();
this._parent.removeMovieClip();
};
arena.btn_deal.btn.onPress = function()
{
_root.buttonSound();
};
arena.attachMovie("btn_standings","btn_standings",this.mydepth++);
if(maxplayers == 5)
{
arena.btn_standings._x = 255;
arena.btn_standings._y = 280;
}
else
{
arena.btn_standings._x = 255;
arena.btn_standings._y = 290;
}
arena.btn_standings.btn.onRelease = function()
{
mygame.myhand.getStandings();
};
arena.btn_standings.btn.onPress = function()
{
_root.buttonSound();
};
mygame.mybubble.makeBubble(5,"Ready to Play?","Press Deal",1,1200);
intID0000 = setInterval(dealsound,900);
}
else
{
_loc3_ = 0;
while(_loc3_ < this.handPlayers.length)
{
table["pBox" + _loc3_].cover._visible = false;
if(mygame.gChip["chip" + _loc3_].c25000 > 0 && (mygame.gChip["chip" + _loc3_].c5000 == 0 || mygame.gChip["chip" + _loc3_].c1000 == 0 || mygame.gChip["chip" + _loc3_].c500 == 0 || mygame.gChip["chip" + _loc3_].c100 == 0))
{
mygame.colorUpChips(_loc3_);
}
_loc3_ = _loc3_ + 1;
}
mygame.moveDealerButton(this.dealerSlot);
PlaySoundEffect("SOUND_SHUFFLE");
this.postAnte();
}
}
function betBoxIbutton(str)
{
PlaySoundEffect("SOUND_CHIP2");
samt = Number(str.substring(1,8));
if(arena.betBox.bal - samt < callamount + minRaise)
{
ok = false;
PlaySoundEffect("SOUND_ATTENTION3");
}
else
{
ok = true;
PlaySoundEffect("SOUND_CHIP2");
mygame.updateBalance(3,samt,"pos");
mygame.addClickables(3);
arena.betBox.bal -= samt;
mygame.gChip.chipBet[str] -= 1;
arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal - callamount,0,",");
}
}
function chipBoxIbutton(str)
{
PlaySoundEffect("SOUND_CHIP2");
samt = Number(str.substring(1,8));
mygame.myhand.addToBet(samt);
arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal - callamount,0,",");
table.chipBox3.mybalance -= samt;
table.chipBox3.enchilada -= samt;
mygame.gChip.chip3[str] -= 1;
table.chipBox3.balance.text = _root.balanceFormat(table.chipBox3.mybalance,0,",");
}
function initAI(who)
{
_level22.initAI(who);
arena.attachMovie("aiman","aiman" + who,mygame.myhand.mydepth++);
arena["aiman" + who].who = who;
arena["aiman" + who].gotoAndStop(2);
}
function checkForTies()
{
numTies = 0;
i = 0;
while(i < wArray.length)
{
if(wArray[i].a != wArray[i + 1].a)
{
i = 500;
break;
}
numTies++;
i++;
}
if(numTies > 0)
{
return true;
}
return false;
}
function getWinner(whoArray)
{
wArray = new Array();
var _loc2_ = 0;
while(_loc2_ < whoArray.length)
{
wArray.push({seat:whoArray[_loc2_],a:_root["bestHand" + whoArray[_loc2_]][0].a});
_loc2_ = _loc2_ + 1;
}
wArray.sortOn("a",18);
who = wArray[0].seat;
winnerName = table["pBox" + who].myname.text;
winnings = arena.potBox.bal;
count = 0;
intID0011 = setInterval(winScript,1750);
trace("WINNER = " + wArray[0].seat + " NAME = " + table["pBox" + wArray[0].seat].myname.text);
trace("HAND = " + _root["bestHand" + wArray[0].seat][0].h);
}
function winScript()
{
if(pauseOn == false)
{
if(count == 0)
{
PlaySoundEffect("SOUND_CHEER");
mygame.mybubble.makeBubble(5,"And the winner is...","blank",1,0);
}
else if(count == 1)
{
PlaySoundEffect("SOUND_CLAP2");
mygame.mybubble.makeBubble(5,winnerName,"blank",1,0);
}
else if(count == 2)
{
PlaySoundEffect("SOUND_CLAP3");
subwinnings = winnings + table["chipBox" + who].enchilada;
trace(subwinnings + " -- " + table["chipBox" + who].enchilada + " winner stuf");
mygame.updateBalance(who,arena.potBox.bal,"pos");
var _loc5_ = undefined;
var _loc3_ = 0;
while(_loc3_ < mygame.myhand.handPlayers.length)
{
_loc5_ = table["chipBox" + _loc3_].enchilada;
if(_loc5_ < 0)
{
_loc5_ -= _loc5_ * 2;
}
table["pBox" + _loc3_].statusBox.display.text = "Lost " + _root.balanceFormat(_loc5_,0,",");
table["pBox" + _loc3_].statusBox.colorBox.gotoAndStop(1);
_loc3_ = _loc3_ + 1;
}
table["chipBox" + who]._visible = true;
table["pBox" + who].statusBox.display.text = "Won " + _root.balanceFormat(subwinnings,0,",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
trace("--------------");
trace("WINNERS BALANCE " + table["chipBox" + who].mybalance);
arena.potBox.bal = 0;
arena.potBox.removeMovieClip();
DoScoreBroadcast();
}
else if(count == 3)
{
PlaySoundEffect("SOUND_CLAP1");
mygame.mybubble.makeBubble(6,winnerName + " wins",_root.balanceFormat(subwinnings,0,","),3,0);
}
count++;
if(count >= 5)
{
var _loc7_ = _root.bigblind;
var _loc8_ = _root.ante;
if(nhrecord == blindincrement || nhrecord == blindincrement * 2 || nhrecord == blindincrement * 3 || nhrecord == blindincrement * 4 || nhrecord == blindincrement * 5 || nhrecord == blindincrement * 6 || nhrecord == blindincrement * 7 || nhrecord == blindincrement * 8 || nhrecord == blindincrement * 9)
{
var _loc9_ = betLevel + 1;
_loc7_ = prePay[_loc9_][0];
_loc8_ = prePay[_loc9_][2];
}
var _loc6_ = new Array();
var _loc4_ = 0;
while(_loc4_ < mygame.myhand.handPlayers.length)
{
if(table["chipBox" + _loc4_].mybalance <= _loc7_ + _loc8_ && table["chipBox" + _loc4_].mybalance != undefined)
{
_loc6_.push(_loc4_);
}
_loc4_ = _loc4_ + 1;
}
if(_loc6_.length > 0)
{
sayGoodbye(_loc6_);
clearInterval(intID0011);
}
else
{
trace("Got here");
if(_global.noZoneAPI == true)
{
trace("no zone");
trace(isGameTimerActive);
if(isGameTimerActive == true)
{
var _loc10_ = getTimer();
if(_loc10_ > gameStartTime + gametimer)
{
if(timeraction == "allin")
{
botsDoAll = true;
getDealStandings();
}
else
{
tableMenu.removeMovieClip();
mygame.myhand.getStandings("expired");
}
}
else
{
getDealStandings();
}
}
else
{
trace(maxHandsAllowed + " === " + numHandsPlayed);
if(maxHandsAllowed > 0)
{
numHandsPlayed++;
if(numHandsPlayed == maxHandsAllowed)
{
if(timeraction == "allin")
{
botsDoAll = true;
getDealStandings();
}
else
{
tableMenu.removeMovieClip();
mygame.myhand.getStandings("maxed");
}
}
else
{
getDealStandings();
}
}
else
{
getDealStandings();
}
}
}
else if(gamebreaker > numHandsPlayedX + 1)
{
numHandsPlayedX++;
numHandsPlayed++;
getDealStandings();
}
else
{
numHandsPlayedX = 0;
DoGameBreak();
}
clearInterval(intID0011);
}
}
}
}
function getDealStandings()
{
PlaySoundEffect("SOUND_SHUFFLE");
var _loc3_ = 0;
while(_loc3_ < mygame.currentPlayers.length)
{
if(mygame.currentPlayers[_loc3_] != "e")
{
table["chipBox" + _loc3_]._visible = true;
}
_loc3_ = _loc3_ + 1;
}
arena.attachMovie("btn_deal","btn_deal",mygame.myhand.mydepth++);
if(maxplayers == 5)
{
arena.btn_deal._x = 175;
arena.btn_deal._y = 283;
}
else
{
arena.btn_deal._x = 255;
arena.btn_deal._y = 255;
}
arena.btn_deal.btn.onRelease = function()
{
killTheHand();
var _loc3_ = mygame.nextDealer(mygame.dealer);
mygame.dealer = _loc3_;
_root.mygame.myhand = new TheHand(_loc3_,mygame.currentPlayers);
arena.btn_standings.removeMovieClip();
this.removeMovieClip();
};
arena.btn_deal.btn.onPress = function()
{
_root.buttonSound();
};
arena.attachMovie("btn_standings","btn_standings",mygame.myhand.mydepth++);
if(maxplayers == 5)
{
arena.btn_standings._x = 175;
arena.btn_standings._y = 316;
}
else
{
arena.btn_standings._x = 255;
arena.btn_standings._y = 290;
}
arena.btn_standings.btn.onRelease = function()
{
mygame.mybubble.killBubble(5);
mygame.mybubble.killBubble(6);
mygame.myhand.getStandings();
};
arena.btn_standings.btn.onPress = function()
{
_root.buttonSound();
};
}
function killTheHand()
{
delete playerKill;
delete gbcount;
delete pkcount;
delete mytry;
delete playerIsInTheGame;
mygame.gChip.chipD.c100 = 0;
mygame.gChip.chipD.c500 = 0;
mygame.gChip.chipD.c1000 = 0;
mygame.gChip.chipD.c5000 = 0;
mygame.gChip.chipD.c25000 = 0;
delete mygame.myhand;
mygame.mybubble.killBubble(5);
mygame.mybubble.killBubble(6);
arena.removeMovieClip();
}
function killTheGame(type)
{
nhrecord = 0;
ntrecord = getTimer();
clearInterval(gijoe);
clearInterval(intID0000);
clearInterval(intID0001);
clearInterval(intID0002);
clearInterval(intID0003);
clearInterval(intID0004);
clearInterval(intID0005);
clearInterval(intID0006);
clearInterval(intID0007);
clearInterval(intID0008);
clearInterval(intID0009);
clearInterval(intID0010);
clearInterval(intID00011);
clearInterval(intID00015);
clearInterval(intID00016);
clearInterval(intID00017);
clearInterval(intID00018);
clearInterval(killme);
trace("killing game now");
killTheHand();
unloadAI();
arena.standings.removeMovieClip();
table.removeMovieClip();
tableMenu.removeMovieClip();
delete mygame;
delete ideal;
delete numOflow;
delete numStacks;
delete xtraPot;
delete p;
delete mycontinue;
delete count;
delete cardcount;
delete cc;
delete cb;
delete callamount;
delete amt;
delete ii;
delete faction;
delete aibet;
delete inc;
delete num;
delete toinc;
delete aiaction;
delete k;
delete myallin;
delete x0;
delete x1;
delete x2;
delete x3;
delete x4;
delete x5;
delete x6;
delete x7;
delete bestHand0;
delete cAr;
delete hAr;
delete ycard1;
delete ycard2;
delete ycard3;
delete ycard4;
delete ycard5;
delete ycard6;
delete ycard7;
delete yz1;
delete yz2;
delete yz3;
delete yz4;
delete yz5;
delete yz6;
delete yz7;
delete playerHand;
delete pairNum0;
delete pairNum1;
delete straight;
delete flush;
delete hc;
delete hh1;
delete hh2;
delete hh3;
delete hh4;
delete hh5;
delete thisPair0;
delete thisPair1;
delete bestHand;
delete dval;
delete handText;
delete aNumber;
delete pos;
delete bestHand1;
delete wom0;
delete wom2;
delete wom1;
delete bestHand2;
delete bestHand3;
delete bestHand4;
delete bestHand5;
delete wom;
delete dval2;
delete wArray;
delete numTies;
delete tie;
delete mywho;
delete winnerName;
delete winnerLastName;
delete winnings;
delete divider;
delete tmpcard;
delete tmploc;
delete who;
delete cashback;
delete mylost;
delete origmylost;
delete killme;
delete finalscore;
delete totalTimePlayed;
delete powerranking;
delete myrank;
delete attachNOchips;
delete amountToCall;
delete adjustedWinnings;
delete adjustedWinnings2;
loadAI();
if(type == "defer")
{
initMenu(true);
stopAllSounds();
}
else if(type == "new")
{
mygame = new Game();
}
else
{
initMenu(true,"nosound");
}
}
function initAllin()
{
myallin = new AllinScreen();
}
myversion = "v1.11.00";
Array.prototype.shuffle = function()
{
var _loc2_ = this.length;
while(_loc2_)
{
var _loc3_ = random(_loc2_);
var _loc4_ = this[_loc2_ = _loc2_ - 1];
this[_loc2_] = this[_loc3_];
this[_loc3_] = _loc4_;
}
};
MovieClip.prototype.fadeTo = function(v_alpha, vel, type)
{
this.onEnterFrame = function()
{
var _loc2_ = this._alpha;
if(type == "out")
{
this._alpha -= (this._alpha - v_alpha) / vel;
if(Math.abs(this._alpha - v_alpha) < 1 || _loc2_ == this._alpha)
{
this._alpha = v_alpha;
this.onEnterFrame = null;
}
}
if(type == "in")
{
this._alpha += (this._alpha + v_alpha) / vel;
if(Math.abs(this._alpha + v_alpha) > 199 || _loc2_ == this._alpha)
{
this._alpha = v_alpha;
this.onEnterFrame = null;
}
}
};
};
MovieClip.prototype.goToPoint = function(x, y, vel, kill)
{
var _loc4_ = undefined;
var _loc3_ = undefined;
var _loc6_ = undefined;
var _loc5_ = undefined;
var movX;
var movY;
!!vel ? null : (vel = 10);
_loc4_ = this._x;
_loc3_ = this._y;
_loc6_ = Math.round(x - _loc4_);
_loc5_ = Math.round(y - _loc3_);
movX = _loc6_ / vel;
movY = _loc5_ / vel;
var movetype = 0;
if(movX < 0 && movY < 0)
{
movetype = 1;
}
if(movX > 0 && movY < 0)
{
movetype = 2;
}
if(movX > 0 && movY > 0)
{
movetype = 3;
}
if(movX < 0 && movY > 0)
{
movetype = 4;
}
var movecount = 0;
this.onEnterFrame = function()
{
endthis = false;
this._y == y ? null : (this._y += movY);
this._x == x ? null : (this._x += movX);
if(movetype == 1 && this._y <= y && this._x <= x)
{
endthis = true;
}
if(movetype == 2 && this._y <= y && this._x >= x)
{
endthis = true;
}
if(movetype == 3 && this._y >= y && this._x >= x)
{
endthis = true;
}
if(movetype == 4 && this._y >= y && this._x <= x)
{
endthis = true;
}
movecount++;
if(movecount > 25)
{
endthis = true;
}
if(endthis == true)
{
this._x = x;
this._y = y;
if(kill == true)
{
this.removeMovieClip();
}
this.onEnterFrame = null;
}
};
};
balanceFormat = function(uknumValue, uknPlaces, strSeparator)
{
strResult = "";
var _loc6_ = false;
var _loc9_ = false;
if(typeof uknumValue == "string")
{
var _loc4_ = parseFloat(uknumValue);
if(isNaN(_loc4_))
{
_loc6_ = true;
}
}
else if(typeof uknumValue == "number")
{
_loc4_ = uknumValue;
}
else
{
_loc6_ = true;
}
if(typeof uknPlaces == "string")
{
var _loc5_ = !(uknPlaces == "" || uknPlaces == null) ? parseInt(uknPlaces) : 0;
if(isNaN(_loc5_))
{
_loc9_ = true;
}
}
else if(typeof uknPlaces == "number")
{
_loc5_ = uknPlaces;
}
else
{
_loc9_ = true;
}
if(_loc6_ || _loc9_)
{
strResult = !(_loc6_ && _loc9_) ? "" : "bad Value & bad Places";
strResult = !!_loc6_ ? "bad Value" : "bad Places";
}
else
{
var _loc12_ = Math.pow(10,_loc5_);
_loc4_ = Math.round(_loc4_ * _loc12_);
var _loc10_ = _loc5_ <= 0 ? "" : "." + String(_loc4_).substr(String(_loc4_).length - _loc5_);
var _loc3_ = String(_loc4_).substr(0,String(_loc4_).length - _loc5_);
strValue = String(parseFloat(strValue));
var _loc2_ = _loc3_.length;
numTriple = Math.floor((_loc2_ - 1) / 3);
numRemainder = (_loc2_ - 1) % 3 + 1;
var _loc1_ = 0;
while(_loc1_ < numTriple)
{
strResult = strSeparator + _loc3_.substr(_loc2_ - 3 * (_loc1_ + 1),3) + strResult;
_loc1_ = _loc1_ + 1;
}
if(numRemainder)
{
strResult = _loc3_.substr(0,numRemainder) + strResult;
}
if(_loc5_ && _loc10_.length)
{
strResult = strResult != "" ? strResult : "0";
strResult += _loc10_;
}
}
return "$" + strResult;
};
idealChips = function(amt)
{
var _loc4_ = new Array(0,0,0,0,0);
var _loc2_ = amt;
var _loc3_ = 0;
if(_loc2_ >= 25000)
{
_loc3_ = 0;
var _loc1_ = 25000;
while(_loc1_ < _loc2_ + 1)
{
if(_loc2_ >= _loc1_)
{
_loc3_ = _loc3_ + 1;
}
_loc1_ += 25000;
}
_loc4_[4] = _loc3_;
_loc2_ -= 25000 * _loc3_;
}
if(_loc2_ >= 5000 && _loc2_ < 25000)
{
_loc3_ = 0;
_loc1_ = 5000;
while(_loc1_ < 25000)
{
if(_loc2_ >= _loc1_)
{
_loc3_ = _loc3_ + 1;
}
_loc1_ += 5000;
}
_loc4_[3] = _loc3_;
_loc2_ -= 5000 * _loc3_;
}
if(_loc2_ >= 1000 && _loc2_ < 5000)
{
_loc3_ = 0;
_loc1_ = 1000;
while(_loc1_ < 5000)
{
if(_loc2_ >= _loc1_)
{
_loc3_ = _loc3_ + 1;
}
_loc1_ += 1000;
}
_loc4_[2] = _loc3_;
_loc2_ -= 1000 * _loc3_;
}
if(_loc2_ >= 500 && _loc2_ < 1000)
{
_loc4_[1] = 1;
_loc2_ -= 500;
}
if(_loc2_ >= 100 && _loc2_ < 500)
{
_loc3_ = 0;
_loc1_ = 100;
while(_loc1_ < 500)
{
if(_loc2_ >= _loc1_)
{
_loc3_ = _loc3_ + 1;
}
_loc1_ += 100;
}
_loc4_[0] = _loc3_;
_loc2_ -= _loc3_ * 100;
}
return _loc4_;
};
_root.gFake = _global.noZoneAPI;
_root.gBreakId = 1;
_root.gGameStartTime = getTimer();
_root.settings = new XML();
_root.settings.getSetting = function(what)
{
var _loc5_ = this.childNodes;
var _loc6_ = _loc5_.length;
var _loc2_ = 0;
while(_loc2_ < _loc6_)
{
var _loc3_ = _loc5_[_loc2_].nodeName;
var _loc4_ = _loc5_[_loc2_].childNodes[0].nodeValue;
if(what == _loc3_)
{
return _loc4_;
}
_loc2_ = _loc2_ + 1;
}
return null;
};
_root.settings.onLoad = function(bSuccess)
{
if(bSuccess)
{
var _loc3_ = this.getSetting("scorebroadcastinterval");
if(_loc3_ != null)
{
_global.scorebroadcastinterval = _loc3_;
}
_loc3_ = this.getSetting("logo");
if(_loc3_ != null)
{
_global.logo = _loc3_;
}
_loc3_ = this.getSetting("file_path");
if(_loc3_ != null)
{
mypath = _loc3_ + "help.txt";
}
_loc3_ = this.getSetting("maxlevels");
if(_loc3_ != null)
{
gamebreaker = Number(_loc3_);
}
_loc3_ = this.getSetting("logobufferx");
if(_loc3_ != null)
{
logobufferx = Number(_loc3_);
}
_loc3_ = this.getSetting("logobuffery");
if(_loc3_ != null)
{
logobuffery = Number(_loc3_);
}
_loc3_ = this.getSetting("blindincrement");
if(_loc3_ != null)
{
blindincrement = Number(_loc3_);
}
_loc3_ = this.getSetting("gametimer");
if(_loc3_ != null)
{
gametimer = Number(_loc3_);
}
_loc3_ = this.getSetting("timertype");
if(_loc3_ != null)
{
timertype = _loc3_;
if(timertype == "hands")
{
maxHandsAllowed = gametimer;
}
else
{
gametimer *= 1000;
isGameTimerActive = true;
}
}
_loc3_ = this.getSetting("timeraction");
if(_loc3_ != null)
{
timeraction = _loc3_;
}
trace("GT " + gametimer);
trace("is GT " + isGameTimerActive);
trace("maxhands " + maxHandsAllowed);
trace("timeraction = " + timeraction);
_loc3_ = this.getSetting("download");
if(_loc3_ != null)
{
_global.download = _loc3_;
}
else
{
_global.realmode = true;
}
_loc3_ = this.getSetting("downloadtype");
if(_loc3_ != null)
{
_global.downloadtype = _loc3_;
}
_loc3_ = this.getSetting("shockwave");
if(_loc3_ != null)
{
_global.noZoneAPI = true;
_global.shockwave = true;
}
_loc3_ = this.getSetting("zone");
if(_loc3_ != null)
{
_global.noZoneAPI = false;
_global.realmode = false;
}
else
{
_global.noZoneAPI = true;
}
}
if(_global.noZoneAPI == true)
{
initSplashScreen(_global.logo);
}
else
{
initSplashScreen(_global.logo,true);
}
};
clearInterval(hubTimer);
Bubble.prototype.makeBubble = function(who, msg0, msg1, mycolor, fader)
{
if(who == 5 || who == 6 || who == 10 || who == "special")
{
PlaySoundEffect("SOUND_ATTENTION4");
this.killBubble(who);
}
var _loc4_ = "";
if(msg1 != "blank")
{
_loc4_ = "l";
}
else
{
_loc4_ = "s";
}
if(who == "special")
{
_loc4_ = "special";
}
var _loc5_ = mygame.gBubble["b" + who].tri;
var _loc7_ = mygame.gBubble["b" + who][_loc4_ + "x"];
var _loc6_ = mygame.gBubble["b" + who][_loc4_ + "y"];
bubbles.attachMovie("bubble" + _loc4_,"bubble" + who,this.mydepth++);
bubbles["bubble" + who]._x = _loc7_;
bubbles["bubble" + who]._y = _loc6_;
bubbles["bubble" + who].msg0.text = msg0;
bubbles["bubble" + who].msg1.text = msg1;
var _loc2_ = 0;
while(_loc2_ < 4)
{
bubbles["bubble" + who]["t" + _loc2_]._visible = false;
_loc2_ = _loc2_ + 1;
}
bubbles["bubble" + who]["t" + _loc5_]._visible = true;
bubbles["bubble" + who]["t" + _loc5_].gotoAndStop(mycolor);
bubbles["bubble" + who].gotoAndStop(mycolor);
if(fader > 0)
{
this.fadeBubble(who,fader);
}
};
Bubble.prototype.fadeBubble = function(who, wait)
{
bubbles["bubble" + who].onEnterFrame = function()
{
bubbles["bubble" + who].wait = wait;
if(!bubbles["bubble" + who].start)
{
bubbles["bubble" + who].start = getTimer();
}
if(bubbles["bubble" + who].start + bubbles["bubble" + who].wait < getTimer())
{
bubbles["bubble" + who]._alpha -= 34;
if(bubbles["bubble" + who]._alpha <= 0)
{
bubbles["bubble" + who].removeMovieClip();
}
}
};
};
Bubble.prototype.killBubble = function(who)
{
if(who)
{
bubbles["bubble" + who].removeMovieClip();
}
else
{
var _loc1_ = 0;
while(_loc1_ < 7)
{
bubbles["bubble" + _loc1_].removeMovieClip();
_loc1_ = _loc1_ + 1;
}
}
};
scoreHand = function(hand)
{
var i;
i = 0;
while(i < 7)
{
var divider = 0;
var suit = 1;
if(hand[i] > 13 && hand[i] < 27)
{
suit = 2;
divider = 13;
}
else if(hand[i] > 26 && hand[i] < 40)
{
suit = 3;
divider = 26;
}
else if(hand[i] > 39)
{
suit = 4;
divider = 39;
}
this["ycard" + (i + 1)] = hand[i] - divider;
this["yz" + (i + 1)] = suit;
i++;
}
i = 1;
while(i < 6)
{
if(this["ycard" + i] == 1)
{
this["ycard" + i] = 14;
}
i++;
}
var sort = 0;
while(sort == 0)
{
sort = 1;
var j = 1;
var tmp = 0;
while(j < 5)
{
if(eval("ycard" + j) > eval("ycard" + (j + 1)))
{
sort = 0;
tmp = eval("ycard" + j);
set("ycard" + j,eval("ycard" + (j + 1)));
set("ycard" + (j + 1),tmp);
tmp = eval("yz" + j);
set("yz" + j,eval("yz" + (j + 1)));
set("yz" + (j + 1),tmp);
}
j += 1;
}
}
playerHand = 0;
pairNum0 = 0;
pairNum1 = 0;
i = 2;
var u0 = 0;
var u1 = 0;
var un = 0;
while(i < 6)
{
if(eval("ycard" + i) == eval("ycard" + (i - 1)))
{
set("u" + un,eval("u" + un) + 1);
set("pairNum" + un,eval("ycard" + i));
}
else if(eval("u" + un) > 0)
{
un += 1;
}
i += 1;
}
if(u0 == 3)
{
playerHand = 7;
}
if(u0 == 2)
{
playerHand = 3;
}
if(u0 == 1)
{
playerHand = 1;
if(_root.gamemode == 1 && pairNum0 < 11)
{
playerHand = 0;
}
}
if(u0 == 2 && u1 == 1 || u0 == 1 && u1 == 2)
{
if(u0 == 2)
{
tmpPN = pairNum0;
tmpPN2 = pairNum1;
}
else
{
tmpPN = pairNum1;
tmpPN2 = pairNum0;
}
pairNum0 = tmpPN;
pairNum1 = tmpPN2;
playerHand = 6;
}
if(u0 == 1 && u1 == 1)
{
playerHand = 2;
}
i = 2;
straight = 1;
while(i < 6)
{
if(eval("ycard" + i) != eval("ycard" + (i - 1)) + 1)
{
straight = 0;
}
i += 1;
}
if(straight == 1 || ycard5 == 14 && ycard2 == 3 && ycard3 == 4 && ycard4 == 5 && ycard1 == 2)
{
straight = 1;
playerHand = 4;
}
i = 2;
flush = 1;
while(i < 6)
{
if(eval("yz" + i) != eval("yz" + (i - 1)))
{
flush = 0;
}
i += 1;
}
if(flush == 1)
{
playerHand = 5;
}
if(straight == 1 && flush == 1)
{
playerHand = 8;
}
if(straight == 1 && flush == 1 && ycard1 == 10 && ycard5 == 14)
{
playerHand = 9;
}
notateHand();
};
notateHand = function()
{
var i;
var a;
hc = 0;
hh1 = ycard1;
hh2 = ycard2;
hh3 = ycard3;
hh4 = ycard4;
hh5 = ycard5;
thisPair0 = pairNum0;
thisPair1 = pairNum1;
bestHand = new Array();
bestHand.push(playerHand);
if(playerHand == 0)
{
i = 5;
while(i > 0)
{
bestHand.push(this["hh" + i]);
i--;
}
dval = getVal(bestHand[1]);
handText = "HIGH CARD - " + dval;
hc = hh5;
}
if(playerHand == 1)
{
a = 0;
i = 1;
while(i < 6)
{
if(eval("hh" + i) != thisPair0)
{
set("wom" + a,eval("hh" + i));
a += 1;
}
i++;
}
bestHand.push(thisPair0);
bestHand.push(wom2);
bestHand.push(wom1);
bestHand.push(wom0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = "Pair of " + dval + "\'s";
hc = wom2;
}
if(playerHand == 2)
{
i = 1;
while(i < 6)
{
if(eval("hh" + i) != thisPair0 and eval("hh" + i) != thisPair1)
{
wom = eval("hh" + i);
}
i++;
}
if(thisPair0 > thisPair1)
{
bestHand.push(thisPair0);
bestHand.push(thisPair1);
}
else
{
bestHand.push(thisPair1);
bestHand.push(thisPair0);
hc = thisPair1;
thisPair1 = thisPair0;
thisPair0 = hc;
}
bestHand.push(wom);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
dval2 = getVal(bestHand[2]);
handText = "Two Pair " + dval + "\'s & " + dval2 + "\'s";
hc = wom;
}
if(playerHand == 3)
{
a = 0;
i = 1;
while(i < 6)
{
if(eval("hh" + i) != thisPair0)
{
set("wom" + a,eval("hh" + i));
a += 1;
}
i++;
}
bestHand.push(thisPair0);
bestHand.push(wom1);
bestHand.push(wom0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = "Three of a Kind " + dval + "\'s";
hc = wom1;
}
if(playerHand == 4)
{
if(hh5 == 14 && hh1 == 2)
{
bestHand.push(hh4);
}
else
{
bestHand.push(hh5);
}
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = dval + " High Straight";
hc = hh5;
}
if(playerHand == 5)
{
i = 5;
while(i > 0)
{
bestHand.push(this["hh" + i]);
i--;
}
dval = getVal(bestHand[1]);
handText = dval + " High Flush";
hc = hh5;
}
if(playerHand == 6)
{
wom = 0;
i = 1;
while(i < 6)
{
if(eval("hh" + i) == thisPair0)
{
wom += 1;
}
i++;
}
if(wom == 3)
{
bestHand.push(thisPair0);
bestHand.push(thisPair1);
hc = thisPair0;
}
if(wom == 2)
{
bestHand.push(thisPair1);
bestHand.push(thisPair0);
hc = thisPair1;
thisPair1 = thisPair0;
thisPair0 = hc;
}
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
dval2 = getVal(bestHand[2]);
handText = "Full House " + dval + "\'s over " + dval2 + "\'s";
}
if(playerHand == 7)
{
i = 1;
while(i < 6)
{
if(eval("hh" + i) != thisPair0)
{
wom = eval("hh" + i);
}
i++;
}
bestHand.push(thisPair0);
bestHand.push(wom);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = "Four of a Kind " + dval + "\'s";
hc = wom;
}
if(playerHand == 8)
{
if(hh5 == 14 && hh1 == 2)
{
bestHand.push(14);
}
else
{
bestHand.push(hh5);
}
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
dval = getVal(bestHand[1]);
handText = "Straight Flush " + dval + " High";
hc = hh5;
}
if(playerHand == 9)
{
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
bestHand.push(0);
handText = "*** Royal Flush ***";
hc = hh5;
}
};
getVal = function(num)
{
if(num == 11)
{
return "JACK";
}
if(num == 12)
{
return "QUEEN";
}
if(num == 13)
{
return "KING";
}
if(num == 14)
{
return "ACE";
}
if(num == 2)
{
return "2";
}
if(num == 3)
{
return "3";
}
if(num == 4)
{
return "4";
}
if(num == 5)
{
return "5";
}
if(num == 6)
{
return "6";
}
if(num == 7)
{
return "7";
}
if(num == 8)
{
return "8";
}
if(num == 9)
{
return "9";
}
if(num == 10)
{
return "10";
}
};
ShockwaveHubDialog.prototype.Init = function()
{
var _loc2_ = "http://www.shockwave.com/content/highscores/scorez-2002.swf";
loadMovie(_loc2_,"_level2");
this.fInterval = setInterval(this,"Timer",100);
};
ShockwaveHubDialog.prototype.End = function()
{
if(this.fInterval != null)
{
clearInterval(this.fInterval);
this.fInterval = null;
}
};
ShockwaveHubDialog.prototype.Timer = function()
{
if(_level2.getBytesTotal() >= 0)
{
clearInterval(this.fInterval);
this.fInterval = null;
}
else
{
var _loc5_ = getTimer();
if(_loc5_ - this.fStart < 30000)
{
var _loc3_ = "";
var _loc4_ = int((_loc5_ - this.fStart) % 1000 / 200);
var _loc2_ = 0;
while(_loc2_ < _loc4_)
{
_loc3_ += ".";
_loc2_ = _loc2_ + 1;
}
this.fClip.msg1.text = "contacting shockwave.com" + _loc3_;
this.fClip.msg2.text = this.fClip.msg1.text;
}
else
{
if(!this.fbDidUnload)
{
this.fbDidUnload = true;
_level2.unloadMovie();
}
this.fClip.msg1.text = "failed to contact shockwave.com";
this.fClip.msg2.text = this.fClip.msg1.text;
if(_loc5_ - this.fStart > 33000)
{
this.End();
}
}
}
};
debug = false;
menudepth = 25;
tabledepth = 50;
rounddepth = 100;
allindepth = 125;
bubbledepth = 150;
tablemenudepth = 200;
pausedepth = 777;
pauseOn = false;
prePay = new Array();
prePay[0] = new Array(2000,1000,200);
prePay[1] = new Array(3000,1500,300);
prePay[2] = new Array(4000,2000,500);
prePay[3] = new Array(6000,3000,500);
prePay[4] = new Array(8000,4000,1000);
prePay[5] = new Array(12000,6000,1000);
prePay[6] = new Array(16000,8000,2000);
prePay[7] = new Array(20000,10000,2000);
prePay[8] = new Array(30000,15000,3000);
prePay[9] = new Array(30000,15000,3000);
prePay[10] = new Array(30000,15000,3000);
prePay[11] = new Array(30000,15000,3000);
prePay[12] = new Array(30000,15000,3000);
prePay[13] = new Array(30000,15000,3000);
prePay[14] = new Array(30000,15000,3000);
prePay[15] = new Array(30000,15000,3000);
loadAI();
betLevel = 0;
getBetLevel();
if(!maxplayers)
{
maxplayers = 5;
}
maxplayers = 4;
maxraises = 3;
logobufferx = 0;
logobuffery = 0;
Game.prototype.introDialog = function()
{
table.attachMovie("dialogRed","introDialog",this.mydepth++);
table.introDialog.btn_play.btn.onRelease = function()
{
mygame.intro();
table.introDialog.removeMovieClip();
};
table.introDialog.btn_play.btn.onPress = function()
{
_root.buttonSound();
};
};
Game.prototype.intro = function()
{
function introCallback()
{
if(pauseOn == false)
{
if(count < introOrder.length)
{
if(count == 0)
{
PlaySoundEffect("SOUND_CLAP4");
table.attachMovie("infoBox","infoBox",_root.mygame.mydepth + 100);
table.infoBox._x = 52;
table.infoBox._y = 317;
}
_root.mygame.createPlayerBoxes(introOrder[count]);
}
else
{
_root.table.infoBox.removeMovieClip();
_root.mygame.mybubble.killBubble();
}
count++;
if(count > introOrder.length)
{
count = 0;
introChips();
clearInterval(intID0001);
}
}
}
function introChips()
{
function introChipsCallback()
{
PlaySoundEffect("SOUND_CHIP1");
_root.mygame.createChips(introOrder[count]);
count++;
if(count >= introOrder.length)
{
_root.mygame.makeNewRound();
clearInterval(intID0003);
}
}
_root.gGameStartTime = getTimer();
intID0003 = setInterval(introChipsCallback,300);
}
var introOrder;
var count = 0;
if(maxplayers == 5)
{
introOrder = new Array(4,0,1,2,3);
}
else
{
introOrder = new Array(4,0,1,3);
}
this.mybubble.makeBubble(5,"Please Welcome","Our Players",0);
intID0001 = setInterval(introCallback,2100);
};
Game.prototype.createPlayerBoxes = function(who)
{
function movePlayerBox(where)
{
PlaySoundEffect("SOUND_SPIN");
var _loc3_ = _root.mygame.gPbox["b" + where].x;
var _loc2_ = _root.mygame.gPbox["b" + where].y;
_root.table["pBox" + where].goToPoint(_loc3_,_loc2_,5);
clearInterval(intID0002);
}
PlaySoundEffect("SOUND_ATTENTION5");
table.infoBox.myname.text = this.gPlayers["player" + who].first + " " + this.gPlayers["player" + who].last;
table.infoBox.mytag.text = this.gPlayers["player" + who].lTag;
table.attachMovie("playerBox","pBox" + who,this.mydepth++);
table["pBox" + who]._x = 244.8;
table["pBox" + who]._y = 118.3;
table["pBox" + who]._xscale = 85;
table["pBox" + who]._yscale = 85;
table["pBox" + who].cover._visible = false;
table["pBox" + who].highlite._visible = false;
table["pBox" + who].statusBox._visible = false;
table["pBox" + who].statusBox.display.text = "";
table["pBox" + who].mybet = 0;
table["pBox" + who].myname.text = this.gPlayers["player" + who].first;
table["pBox" + who].mylastname = this.gPlayers["player" + who].last;
if(who == 3)
{
table["pBox" + who].player.gotoAndStop("player");
}
else
{
table["pBox" + who].player.gotoAndStop(this.gPlayers["player" + who].first);
}
intID0002 = setInterval(movePlayerBox,1600,who);
};
Game.prototype.createChips = function(who)
{
table.attachMovie("chipBox","chipBox" + who,this.mydepth++);
table["chipBox" + who]._x = this.gPbox["b" + who].chipx;
table["chipBox" + who]._y = this.gPbox["b" + who].chipy;
table["chipBox" + who].mybalance = this.defaultBalance;
table["chipBox" + who].balance.text = balanceFormat(table["chipBox" + who].mybalance,0,",");
table["chipBox" + who].chipCount = new Object();
table["chipBox" + who].chipCount = this.gChip.defaultChips;
this.makeChipStacks(who);
};
Game.prototype.colorUpChips = function(who)
{
var _loc3_ = new Array();
_loc3_ = this.getP(who);
if(_loc3_[4].amt > 0)
{
if(_loc3_[4].amt > 1 && _loc3_[3].amt < 5)
{
this.gChip["chip" + who].c100 += 10;
this.gChip["chip" + who].c500 += 10;
this.gChip["chip" + who].c1000 += 14;
this.gChip["chip" + who].c5000 += 6;
this.gChip["chip" + who].c25000 -= 2;
}
else
{
this.gChip["chip" + who].c100 += 10;
this.gChip["chip" + who].c500 += 10;
this.gChip["chip" + who].c1000 += 14;
this.gChip["chip" + who].c5000 += 1;
this.gChip["chip" + who].c25000 -= 1;
}
}
this.clearChips(who);
this.makeChipStacks(who);
};
Game.prototype.makeChipStacks = function(who)
{
oflow = this.gChip.oflow;
p = this.getP(who);
checkAgain = true;
while(checkAgain == true)
{
getStacks();
}
sortChips();
var _loc2_ = 0;
while(_loc2_ < 6)
{
this["stack" + _loc2_] = new Object();
this["stack" + _loc2_].amt = p[0].amt;
this["stack" + _loc2_].n = p[0].n;
if(this["stack" + _loc2_].amt > oflow)
{
this["stack" + _loc2_].amt = oflow;
p[0].amt -= oflow;
}
else
{
p[0].amt = 0;
}
sortChips();
_loc2_ = _loc2_ + 1;
}
this.cdpth = 0;
table["chipBox" + who].chipcount = 0;
_loc2_ = 0;
while(_loc2_ < 6)
{
var _loc4_ = 0;
while(_loc4_ < this["stack" + _loc2_].amt)
{
table["chipBox" + who].attachMovie("chipmaster","chip" + this.cdpth,this.cdpth++);
table["chipBox" + who]["chip" + this.cdpth]._x = this.gChip["chip" + _loc2_].x;
table["chipBox" + who]["chip" + this.cdpth]._y = this.gChip["chip" + _loc2_].y - this.gChip.inc * _loc4_;
table["chipBox" + who]["chip" + this.cdpth].gotoAndStop(this["stack" + _loc2_].n);
table["chipBox" + who]["chip" + this.cdpth].myvalue = this["stack" + _loc2_].n;
table["chipBox" + who].chipcount = table["chipBox" + who].chipcount + 1;
_loc4_ = _loc4_ + 1;
}
_loc2_ = _loc2_ + 1;
}
};
Game.prototype.addClickables = function(who)
{
var _loc2_ = 0;
while(_loc2_ < table["chipBox" + who].chipcount)
{
table["chipBox" + who]["chip" + _loc2_].iButton.gotoAndStop(2);
table["chipBox" + who]["chip" + _loc2_].iButton.btn.onRelease = function()
{
str = this._parent._parent.myvalue;
chipBoxIbutton(str);
this._parent._parent.removeMovieClip();
};
_loc2_ = _loc2_ + 1;
}
};
Game.prototype.clearChips = function(who)
{
var _loc1_ = 0;
while(_loc1_ < table["chipBox" + who].chipcount + 1)
{
table["chipBox" + who]["chip" + _loc1_].removeMovieClip();
_loc1_ = _loc1_ + 1;
}
};
Game.prototype.getP = function(who)
{
anArray = new Array();
anArray.push({n:"c100",amt:this.gChip["chip" + who].c100,tonext:5,toprev:0});
anArray.push({n:"c500",amt:this.gChip["chip" + who].c500,tonext:2,toprev:5});
anArray.push({n:"c1000",amt:this.gChip["chip" + who].c1000,tonext:5,toprev:2});
anArray.push({n:"c5000",amt:this.gChip["chip" + who].c5000,tonext:5,toprev:5});
anArray.push({n:"c25000",amt:this.gChip["chip" + who].c25000,tonext:0,toprev:5});
return anArray;
};
Game.prototype.updateBalance = function(who, amt, type)
{
function unconvertChip(chip, amt)
{
if(p[chip].amt < amt)
{
found = false;
var _loc1_ = chip + 1;
while(found == false)
{
if(p[_loc1_].amt > 0)
{
found = true;
}
else
{
_loc1_ = _loc1_ + 1;
}
}
p[_loc1_].amt -= 1;
p[_loc1_ - 1].amt += p[_loc1_].toprev;
if(_loc1_ - 1 == chip)
{
mycontinue = false;
}
else
{
mycontinue = true;
}
}
else
{
mycontinue = false;
}
}
var _loc3_ = undefined;
var _loc7_ = undefined;
if(type == "pos")
{
table["chipBox" + who].mybalance += amt;
table["chipBox" + who].enchilada += amt;
}
else
{
table["chipBox" + who].mybalance -= amt;
table["chipBox" + who].enchilada -= amt;
}
table["chipBox" + who].balance.text = _root.balanceFormat(table["chipBox" + who].mybalance,0,",");
ideal = idealChips(amt);
if(table["chipBox" + who].mybalance > 0)
{
if(type == "pos")
{
this.gChip["chip" + who].c100 += ideal[0];
this.gChip["chip" + who].c500 += ideal[1];
this.gChip["chip" + who].c1000 += ideal[2];
this.gChip["chip" + who].c5000 += ideal[3];
this.gChip["chip" + who].c25000 += ideal[4];
}
else
{
p = mygame.getP(who);
_loc7_ = mygame.getMyColor(who);
if(amt > table["chipBox" + who].mybalance)
{
_loc7_ = true;
}
if(_loc7_ == false)
{
_loc3_ = 0;
while(_loc3_ < ideal.length)
{
if(ideal[_loc3_] > 0)
{
mycontinue = true;
while(mycontinue == true)
{
unconvertChip(_loc3_,ideal[_loc3_]);
}
}
p[_loc3_].amt -= ideal[_loc3_];
_loc3_ = _loc3_ + 1;
}
this.gChip["chip" + who].c100 = p[0].amt;
this.gChip["chip" + who].c500 = p[1].amt;
this.gChip["chip" + who].c1000 = p[2].amt;
this.gChip["chip" + who].c5000 = p[3].amt;
this.gChip["chip" + who].c25000 = p[4].amt;
}
else
{
ideal = idealChips(table["chipBox" + who].mybalance);
this.gChip["chip" + who].c100 = ideal[0];
this.gChip["chip" + who].c500 = ideal[1];
this.gChip["chip" + who].c1000 = ideal[2];
this.gChip["chip" + who].c5000 = ideal[3];
this.gChip["chip" + who].c25000 = ideal[4];
}
}
}
else
{
this.gChip["chip" + who].c100 = 0;
this.gChip["chip" + who].c500 = 0;
this.gChip["chip" + who].c1000 = 0;
this.gChip["chip" + who].c5000 = 0;
this.gChip["chip" + who].c25000 = 0;
}
this.clearChips(who);
this.makeChipStacks(who);
if(_loc7_ == true)
{
if(this.gChip["chip" + who].c25000 > 0 && (this.gChip["chip" + who].c5000 == 0 || this.gChip["chip" + who].c1000 == 0 || this.gChip["chip" + who].c500 == 0 || this.gChip["chip" + who].c100 == 0))
{
mygame.colorUpChips(who);
}
}
};
Game.prototype.getMyColor = function(who)
{
var _loc1_ = false;
i = 4;
while(i > 0)
{
if(ideal[i] > 0 && p[i].amt < ideal[i])
{
_loc1_ = true;
break;
}
if(_loc1_ == false && ideal[i] == 0 && p[i].amt > 0)
{
_loc1_ = false;
break;
}
i--;
}
return _loc1_;
};
Game.prototype.addToPot = function(amt)
{
var _loc2_ = undefined;
ideal = idealChips(amt);
this.gChip.chipD.c100 += ideal[0];
this.gChip.chipD.c500 += ideal[1];
this.gChip.chipD.c1000 += ideal[2];
this.gChip.chipD.c5000 += ideal[3];
this.gChip.chipD.c25000 += ideal[4];
_loc2_ = 0;
while(_loc2_ < arena.potBox.chipcount + 1)
{
arena.potBox["chip" + _loc2_].removeMovieClip();
_loc2_ = _loc2_ + 1;
}
oflow = this.gChip.oflow;
p = new Array();
p.push({n:"c100",amt:this.gChip.chipD.c100,tonext:5,toprev:0});
p.push({n:"c500",amt:this.gChip.chipD.c500,tonext:2,toprev:5});
p.push({n:"c1000",amt:this.gChip.chipD.c1000,tonext:5,toprev:2});
p.push({n:"c5000",amt:this.gChip.chipD.c5000,tonext:5,toprev:5});
p.push({n:"c25000",amt:this.gChip.chipD.c25000,tonext:0,toprev:5});
checkAgain = true;
while(checkAgain == true)
{
getStacks(4);
}
sortChips();
_loc2_ = 0;
while(_loc2_ < 10)
{
this["stack" + _loc2_] = new Object();
this["stack" + _loc2_].amt = p[0].amt;
this["stack" + _loc2_].n = p[0].n;
if(this["stack" + _loc2_].amt > oflow)
{
this["stack" + _loc2_].amt = oflow;
p[0].amt -= oflow;
}
else
{
p[0].amt = 0;
}
sortChips();
_loc2_ = _loc2_ + 1;
}
this.cdpth = 0;
arena.potBox.chipcount = 0;
_loc2_ = 0;
while(_loc2_ < 6)
{
var _loc3_ = 0;
while(_loc3_ < this["stack" + _loc2_].amt)
{
arena.potBox.attachMovie("chipmaster","chip" + this.cdpth,this.cdpth++);
arena.potBox["chip" + this.cdpth]._x = this.gChip["mchip" + _loc2_].x;
arena.potBox["chip" + this.cdpth]._y = this.gChip["mchip" + _loc2_].y - this.gChip.inc * _loc3_;
arena.potBox["chip" + this.cdpth].gotoAndStop(this["stack" + _loc2_].n);
arena.potBox.chipcount = arena.potBox.chipcount + 1;
_loc3_ = _loc3_ + 1;
}
_loc2_ = _loc2_ + 1;
}
};
Game.prototype.addToBetBox = function(amt)
{
ideal = idealChips(amt);
this.gChip.chipBet.c100 += ideal[0];
this.gChip.chipBet.c500 += ideal[1];
this.gChip.chipBet.c1000 += ideal[2];
this.gChip.chipBet.c5000 += ideal[3];
this.gChip.chipBet.c25000 += ideal[4];
var _loc2_ = 0;
while(_loc2_ < arena.betBox.chipcount + 1)
{
arena.betBox["chip" + _loc2_].removeMovieClip();
_loc2_ = _loc2_ + 1;
}
oflow = this.gChip.oflow;
p = new Array();
p.push({n:"c100",amt:this.gChip.chipBet.c100,tonext:5,toprev:0});
p.push({n:"c500",amt:this.gChip.chipBet.c500,tonext:2,toprev:5});
p.push({n:"c1000",amt:this.gChip.chipBet.c1000,tonext:5,toprev:2});
p.push({n:"c5000",amt:this.gChip.chipBet.c5000,tonext:5,toprev:5});
p.push({n:"c25000",amt:this.gChip.chipBet.c25000,tonext:0,toprev:5});
checkAgain = true;
while(checkAgain == true)
{
getStacks();
}
sortChips();
_loc2_ = 0;
while(_loc2_ < 10)
{
this["stack" + _loc2_] = new Object();
this["stack" + _loc2_].amt = p[0].amt;
this["stack" + _loc2_].n = p[0].n;
if(this["stack" + _loc2_].amt > oflow)
{
this["stack" + _loc2_].amt = oflow;
p[0].amt -= oflow;
}
else
{
p[0].amt = 0;
}
sortChips();
_loc2_ = _loc2_ + 1;
}
this.cdpth = 0;
arena.betBox.chipcount = 0;
_loc2_ = 0;
while(_loc2_ < 6)
{
var _loc3_ = 0;
while(_loc3_ < this["stack" + _loc2_].amt)
{
arena.betBox.attachMovie("chipmaster","chip" + this.cdpth,this.cdpth++);
arena.betBox["chip" + this.cdpth]._x = this.gChip["bchip" + _loc2_].x;
arena.betBox["chip" + this.cdpth]._y = this.gChip["bchip" + _loc2_].y - this.gChip.inc * _loc3_;
arena.betBox["chip" + this.cdpth].gotoAndStop(this["stack" + _loc2_].n);
arena.betBox["chip" + this.cdpth].myvalue = this["stack" + _loc2_].n;
arena.betBox["chip" + this.cdpth].iButton.gotoAndStop(2);
arena.betBox["chip" + this.cdpth].iButton.btn.onRelease = function()
{
str = this._parent._parent.myvalue;
betBoxIbutton(str);
if(ok == true)
{
this._parent._parent.removeMovieClip();
}
};
arena.betBox.chipcount = arena.betBox.chipcount + 1;
_loc3_ = _loc3_ + 1;
}
_loc2_ = _loc2_ + 1;
}
};
Game.prototype.placeDealerButton = function(who)
{
table.dealerButton._x = this.gPbox["b" + who].dbx;
table.dealerButton._y = this.gPbox["b" + who].dby;
};
Game.prototype.moveDealerButton = function(who)
{
var _loc4_ = this.gPbox["b" + who].dbx;
var _loc3_ = this.gPbox["b" + who].dby;
table.dealerButton._x = this.gPbox["b" + who].dbx;
table.dealerButton._y = this.gPbox["b" + who].dby;
};
Game.prototype.nextDealer = function(slot)
{
var _loc2_ = undefined;
var _loc3_ = slot;
var _loc4_ = true;
while(this.currentPlayers[_loc2_] == "e" || _loc4_ == true)
{
_loc4_ = false;
_loc2_ = _loc3_ + 1;
if(_loc2_ == this.currentPlayers.length)
{
_loc2_ = 0;
}
if(this.currentPlayers[_loc2_] == "e")
{
_loc3_ = _loc3_ + 1;
if(_loc3_ == this.currentPlayers.length)
{
_loc3_ = 0;
}
}
if(_loc3_ == 25)
{
this.currentPlayers[_loc2_] = 4;
}
}
return _loc2_;
};
Game.prototype.makeNewRound = function()
{
mygame.myhand = new TheHand(this.dealer,this.currentPlayers,true);
};
Game.prototype.killPlayer = function(who)
{
var _loc2_ = 0;
while(_loc2_ < this.currentPlayers.length)
{
if(this.currentPlayers[_loc2_] == who)
{
this.currentPlayers.splice(_loc2_,1);
break;
}
_loc2_ = _loc2_ + 1;
}
table["pBox" + who].removeMovieClip();
table["chipBox" + who].removeMovieClip();
};
TheHand.prototype.makePot = function(type)
{
if(!type)
{
arena.attachMovie("potBox","potBox",this.mydepth++);
arena.potBox.bal = 0;
arena.potBox.chipCount = 0;
arena.potBox._x = mygame.gChip.chipD.x;
arena.potBox._y = mygame.gChip.chipD.y;
}
else
{
arena.attachMovie("betBox","betBox",this.mydepth++);
arena.betBox.bal = 0;
arena.betBox.chipCount = 0;
arena.betBox._x = mygame.gChip.chipBet.x;
arena.betBox._y = mygame.gChip.chipBet.y;
mygame.gChip.chipBet.c100 = 0;
mygame.gChip.chipBet.c500 = 0;
mygame.gChip.chipBet.c1000 = 0;
mygame.gChip.chipBet.c5000 = 0;
mygame.gChip.chipBet.c25000 = 0;
}
};
TheHand.prototype.addToPot = function(amt, pot, addStore)
{
if(!pot)
{
pot = 0;
}
if(!addStore)
{
this.potStore[pot] += amt;
trace(this.potStore[pot]);
}
arena.potBox.bal += amt;
arena.potBox.balance.text = _root.balanceFormat(arena.potBox.bal,0,",");
mygame.addToPot(amt);
};
TheHand.prototype.createBet = function(callamountB)
{
var _loc3_ = undefined;
this.makePot("bet");
callamount = callamountB;
minRaise = bigblind;
arena.betBox.callamt.text = _root.balanceFormat(callamount,0,",");
amt = callamount + minRaise;
this.addToBet(amt);
arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal - callamount,0,",");
mygame.updateBalance(3,amt);
_loc3_ = 0;
while(_loc3_ < arena.betBox.chipcount + 1)
{
arena.betBox["chip" + _loc3_].iButton.gotoAndStop(2);
arena.betBox["chip" + _loc3_].iButton.btn.onRelease = function()
{
mygame.isNew = false;
str = this._parent._parent.myvalue;
betBoxIbutton(str);
if(ok == true)
{
this._parent._parent.removeMovieClip();
}
};
_loc3_ = _loc3_ + 1;
}
_loc3_ = 0;
while(_loc3_ < table.chipBox3.chipcount + 1)
{
table.chipBox3["chip" + _loc3_].iButton.gotoAndStop(2);
table.chipBox3["chip" + _loc3_].iButton.btn.onRelease = function()
{
mygame.isNew = false;
str = this._parent._parent.myvalue;
chipBoxIbutton(str);
this._parent._parent.removeMovieClip();
};
_loc3_ = _loc3_ + 1;
}
};
TheHand.prototype.addToBet = function(amt)
{
arena.betBox.bal += amt;
arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal,0,",");
mygame.addToBetBox(amt);
};
TheHand.prototype.postAnte = function()
{
mygame.mybubble.makeBubble(5,"Ante Up","blank",1,750);
arena.ct = 0;
trace("1 " + this.handPlayers[this.dealerSlot] + " --- 2 " + this.handPlayers);
this.playOrder = this.getPlayOrder(this.handPlayers[this.dealerSlot],this.handPlayers);
trace("POSTING ANTE " + this.playOrder);
intID0004 = setInterval(this.placeAnte,200);
};
TheHand.prototype.placeAnte = function()
{
if(pauseOn == false)
{
PlaySoundEffect("SOUND_CHIP1");
var _loc2_ = mygame.myhand.playOrder[arena.ct];
table["pBox" + _loc2_].statusBox.display.text = "Ante " + _root.balanceFormat(mygame.ante,0,",");
table["pBox" + _loc2_].statusBox._visible = true;
table["pBox" + _loc2_].statusBox.colorBox.gotoAndStop(1);
mygame.updateBalance(_loc2_,mygame.ante);
mygame.myhand.addToPot(mygame.ante,0,true);
mygame.myhand.basicPot += mygame.ante;
arena.ct = arena.ct + 1;
if(arena.ct >= mygame.myhand.playOrder.length)
{
mygame.myhand.postBlinds(mygame.myhand.handPlayers[mygame.myhand.dealerSlot]);
clearInterval(intID0004);
}
}
};
TheHand.prototype.postBlinds = function(slot)
{
function doPostBlinds()
{
if(pauseOn == false)
{
mygame.myhand.betStart = mygame.myhand.returnNextPlayer(mygame.myhand.betStart);
PlaySoundEffect("SOUND_CHIP1");
var _loc3_ = table["pBox" + mygame.myhand.playOrder[count]].myname.text;
var _loc2_ = mygame.myhand.playOrder[count];
trace("BLIND to " + _loc2_);
if(count == 0)
{
mygame.mybubble.makeBubble(6,_loc3_ + " posts","the Small Blind",1,750);
mygame.mybubble.makeBubble(mygame.myhand.playOrder[count],"posting " + _root.balanceFormat(mygame.smallblind,0,","),"blank",1,1250);
table["pBox" + _loc2_].statusBox.display.text = "Posting " + _root.balanceFormat(mygame.smallblind,0,",");
table["pBox" + _loc2_].statusBox.colorBox.gotoAndStop(3);
mygame.updateBalance(_loc2_,mygame.smallblind);
mygame.myhand.addToPot(mygame.smallblind,0);
table["pBox" + _loc2_].mybet = mygame.smallblind;
}
else
{
mygame.mybubble.makeBubble(5,_loc3_ + " posts","the Big Blind",1,750);
mygame.mybubble.makeBubble(mygame.myhand.playOrder[count],"posting " + _root.balanceFormat(mygame.bigblind,0,","),"blank",1,1250);
table["pBox" + _loc2_].statusBox.display.text = "Posting " + _root.balanceFormat(mygame.bigblind,0,",");
table["pBox" + _loc2_].statusBox.colorBox.gotoAndStop(3);
mygame.updateBalance(_loc2_,mygame.bigblind);
mygame.myhand.addToPot(mygame.bigblind,0);
table["pBox" + _loc2_].mybet = mygame.bigblind;
mygame.myhand.currentBet += mygame.bigblind;
mygame.myhand.dealCards();
clearInterval(intID0005);
}
count++;
}
}
mygame.mybubble.makeBubble(5,table["pBox" + slot].myname.text,"is the Dealer",1,1250);
count = 0;
intID0005 = setInterval(doPostBlinds,1250);
};
TheHand.prototype.dealCards = function()
{
trace("DEALING CARDS");
this.deck = new Array();
var _loc2_ = 1;
while(_loc2_ < 53)
{
this.deck.push(_loc2_);
_loc2_ = _loc2_ + 1;
}
this.deck.shuffle();
if(debug == true)
{
this.deck[0] = 2;
this.deck[1] = 15;
this.deck[2] = 4;
this.deck[3] = 17;
this.deck[4] = 18;
this.deck[5] = 31;
this.deck[6] = 47;
this.deck[7] = 48;
this.deck[8] = 50;
}
cardcount = 0;
intID0006 = setInterval(this.deliverCard,200);
};
TheHand.prototype.deliverCard = function()
{
PlaySoundEffect("SOUND_DEAL2");
if(cardcount < mygame.myhand.playOrder.length)
{
var _loc3_ = mygame.myhand.playOrder[cardcount];
cc = 0;
}
else
{
var _loc6_ = cardcount - mygame.myhand.playOrder.length;
_loc3_ = mygame.myhand.playOrder[_loc6_];
cc = 1;
}
var _loc2_ = "card_" + _loc3_ + "_" + cc;
arena.attachMovie("card",_loc2_,mygame.myhand.mydepth++);
arena[_loc2_]._xscale = 75;
arena[_loc2_]._yscale = 75;
arena[_loc2_]._x = 220;
arena[_loc2_]._y = 10;
arena[_loc2_].mycard = mygame.myhand.deck[cardcount];
arena[_loc2_].gotoAndStop(mygame.myhand.deck[cardcount]);
if(_loc3_ == 3 || debug == true)
{
arena[_loc2_].cardback._visible = false;
}
var _loc5_ = _root.mygame.gPbox["b" + _loc3_].cx + 12 * cc;
var _loc4_ = _root.mygame.gPbox["b" + _loc3_].cy + 3 * cc;
arena[_loc2_].goToPoint(_loc5_,_loc4_,3);
cardcount++;
if(cardcount >= mygame.myhand.playOrder.length * 2)
{
mygame.myhand.getBigCards();
clearInterval(intID0006);
}
};
TheHand.prototype.getBigCards = function()
{
function doSwap(t0, t1)
{
if(count == 0)
{
PlaySoundEffect("SOUND_SPIN");
var _loc3_ = 240;
var _loc2_ = 405;
arena.card_3_0.goToPoint(_loc3_,_loc2_,3,true);
_loc3_ = 240;
_loc2_ = 405;
arena.card_3_1.goToPoint(_loc3_,_loc2_,3,true);
}
else if(count == 1)
{
var _loc1_ = "card_3_0";
arena.attachMovie("card",_loc1_,mygame.myhand.mydepth++);
if(maxplayers == 5)
{
arena[_loc1_]._x = 295;
arena[_loc1_]._y = 335;
}
else
{
arena[_loc1_]._x = 252;
arena[_loc1_]._y = 354;
}
arena[_loc1_].mycard = t0;
arena[_loc1_].gotoAndStop(t0);
arena[_loc1_].cardback._visible = false;
_loc1_ = "card_3_1";
arena.attachMovie("card",_loc1_,mygame.myhand.mydepth++);
if(maxplayers == 5)
{
arena[_loc1_]._x = 325;
arena[_loc1_]._y = 340;
}
else
{
arena[_loc1_]._x = 282;
arena[_loc1_]._y = 359;
}
arena[_loc1_].mycard = t1;
arena[_loc1_].gotoAndStop(t1);
arena[_loc1_].cardback._visible = false;
}
count++;
if(count == 2)
{
mygame.myhand.startBetting();
clearInterval(intID0007);
}
}
count = 0;
var _loc4_ = arena.card_3_0._currentframe;
var _loc5_ = arena.card_3_1._currentframe;
intID0007 = setInterval(doSwap,350,_loc4_,_loc5_);
};
TheHand.prototype.dealCommunityCards = function()
{
function doComm()
{
PlaySoundEffect("SOUND_DEAL2");
var _loc1_ = "card_comm_" + mygame.myhand.commcardcount;
arena.attachMovie("card",_loc1_,mygame.myhand.mydepth++);
arena[_loc1_]._xscale = 75;
arena[_loc1_]._yscale = 75;
arena[_loc1_]._x = 220;
arena[_loc1_]._y = 10;
arena[_loc1_].mycard = mygame.myhand.deck[cardcount];
arena[_loc1_].gotoAndStop(mygame.myhand.deck[cardcount]);
arena[_loc1_].cardback._visible = false;
if(maxplayers == 5)
{
var _loc3_ = 140 + inc * toinc;
var _loc2_ = 179;
}
else
{
_loc3_ = 175 + inc * toinc;
_loc2_ = 175;
}
arena[_loc1_].goToPoint(_loc3_,_loc2_,3);
toinc++;
count++;
cardcount++;
mygame.myhand.commcardcount = mygame.myhand.commcardcount + 1;
if(count >= num)
{
intID0010 = setInterval(endComm,1000);
clearInterval(intID0008);
}
}
function endComm()
{
mygame.myhand.keepBetting();
clearInterval(intID0010);
}
inc = 50;
if(this.dealType[0] == "flop")
{
num = 3;
toinc = 0;
}
else if(this.dealType[0] == "turn")
{
num = 1;
toinc = 3;
}
else if(this.dealType[0] == "river")
{
num = 1;
toinc = 4;
}
mygame.mybubble.makeBubble(5,"The " + this.dealType[0],"blank",1,1000);
this.dealType.splice(0,1);
count = 0;
intID0008 = setInterval(doComm,350);
};
TheHand.prototype.gotoPlayer = function()
{
if(pauseOn == false)
{
if(this.AllInPool[this.betStart] <= 0)
{
var _loc2_ = table["pBox" + this.betStart].myname.text;
mygame.mybubble.makeBubble(5,_loc2_ + "?","blank",1,0);
table["pBox" + this.betStart].highlite._visible = true;
}
this.determineBetButtons(this.betStart);
}
else
{
pauseReturnAction = "gotoPlayer";
}
};
TheHand.prototype.determineBetButtons = function(who)
{
var _loc8_ = table["pBox" + who].mybet;
var _loc6_ = false;
_root.attachNOchips = false;
var _loc5_ = false;
var _loc9_ = new Array();
_loc9_ = this.whosLeft();
if(this.AllInActive == _loc9_.length - 1 && who == 3)
{
_loc5_ = true;
}
trace("ALLIN = " + this.AllInActive);
trace("PLAYERS LEFT = " + _loc9_);
trace("PLAYERS LEFT len = " + _loc9_.length);
trace("SPECAC = " + _loc5_);
trace("CURRENT BET = " + this.currentBet);
trace("PLAYER BET = " + _loc8_);
if(this.AllInPool[who] > 0 && who != 3 && this.betStart != 3)
{
_loc5_ = true;
this.betStart = this.returnNextPlayer(this.betStart);
this.playOrder = this.getPlayOrder(this.betStart,this.handPlayers);
this.gotoPlayer();
}
if(this.currentBet > 0 && _loc8_ >= this.currentBet && _loc5_ == true && who == 3)
{
_root.attachNOchips = true;
this.attachBetButtons(who,"allin","","","","",cb,_root.attachNOchips);
}
if(this.currentBet > 0 && _loc8_ < this.currentBet && _loc5_ == true && who == 3)
{
_root.attachNOchips = true;
this.attachBetButtons(who,"allin","fold","","","",cb,_root.attachNOchips);
}
if(this.currentBet + minRaise >= table["chipBox" + who].mybalance && _loc5_ == false)
{
_loc6_ = true;
cb = this.currentBet;
_root.attachNOchips = true;
if(this.currentBet == 0)
{
this.attachBetButtons(who,"allin","check","fold","","",cb,_root.attachNOchips);
}
else
{
this.attachBetButtons(who,"allin","fold","","","",cb,_root.attachNOchips);
}
}
if(this.currentBet == 0 && _loc6_ == false && _loc5_ == false)
{
_loc6_ = true;
cb = this.currentBet;
this.attachBetButtons(who,"allin","bet","check","","",cb,_root.attachNOchips);
}
if(this.currentBet > 0 && _loc8_ < this.currentBet && _loc6_ == false && _loc5_ == false)
{
_loc6_ = true;
cb = this.currentBet - _loc8_;
if(this.numRaises >= _root.maxraises)
{
if(this.AllInActive > true)
{
_root.attachNOchips = true;
this.attachBetButtons(who,"allin","fold","","","",cb,_root.attachNOchips);
}
else
{
_root.attachNOchips = true;
this.attachBetButtons(who,"call","fold","","","",cb,_root.attachNOchips);
}
}
else
{
var _loc7_ = this.AllInActive;
var _loc3_ = 0;
while(_loc3_ < this.handPlayers.length)
{
if(this.handPlayers == "f" || this.handPlayers == "e")
{
_loc7_ = _loc7_ + 1;
}
_loc3_ = _loc3_ + 1;
}
if(_loc7_ >= 3)
{
_root.attachNOchips = true;
this.attachBetButtons(who,"allin","fold","","","",cb,_root.attachNOchips);
}
else
{
this.attachBetButtons(who,"allin","raise","call","fold","",cb,_root.attachNOchips);
}
}
}
if(this.currentBet > 0 && _loc8_ == this.currentBet && _loc6_ == false && _loc5_ == false)
{
_loc6_ = true;
cb = 0;
this.attachBetButtons(who,"allin","raise","check","","",cb,_root.attachNOchips);
}
};
TheHand.prototype.attachBetButtons = function(who, b0, b1, b2, b3, b4, cb, isChips)
{
if(who == 3)
{
if(!isChips)
{
if(mygame.gChip.chip3.c25000 > 0 && (mygame.gChip.chip3.c5000 == 0 || mygame.gChip.chip3.c1000 == 0 || mygame.gChip.chip3.c500 == 0 || mygame.gChip.chip3.c100 == 0))
{
mygame.colorUpChips(3);
}
this.createBet(cb);
}
var myname = "";
if(maxplayers == 5)
{
var inc = 27;
var x = 175;
var y = 258;
}
else
{
var inc = 23;
var x = 265;
var y = 260.4;
}
arena.attachMovie("chipclicktext","chipclicktext",mygame.myhand.mydepth++);
if(mygame.isNew == true && (this.dealType[0] == "flop" || this.dealType[0] == "turn"))
{
arena.chipclicktext._visible = true;
}
else
{
arena.chipclicktext._visible = false;
}
arena.chipclicktext._x = 394;
arena.chipclicktext._y = 163;
var i = 0;
while(i < 5)
{
var action = eval("b" + i);
if(action != "")
{
myname = "bb_" + action;
arena.attachMovie(myname,myname,mygame.myhand.mydepth++);
arena[myname]._x = x;
arena[myname]._y = y + i * inc;
arena[myname].action = action;
arena[myname].who = who;
arena[myname].btn.onRelease = function()
{
mygame.myhand.doBetAction(this._parent.who,this._parent.action);
};
arena[myname].btn.onPress = function()
{
_root.buttonSound();
};
}
i++;
}
}
else
{
_root.initAI(who);
}
};
TheHand.prototype.killBetButtons = function()
{
arena.chipclicktext.removeMovieClip();
arena.bb_allin.removeMovieClip();
arena.bb_raise.removeMovieClip();
arena.bb_bet.removeMovieClip();
arena.bb_call.removeMovieClip();
arena.bb_check.removeMovieClip();
arena.bb_fold.removeMovieClip();
};
TheHand.prototype.doAIBetAction = function(who)
{
faction = undefined;
aibet = _level22.mybet;
if(aibet + 2 + 3 != aibet + 5)
{
aibet = bigblind;
}
aiaction = _level22.myaction[0];
if(aibet == table["chipBox" + who].mybalance && aiaction == "R")
{
faction = "allin";
}
if(aibet + this.currentBet >= table["chipBox" + who].mybalance - 10000 && aiaction == "R")
{
faction = "allin";
}
if(faction != "allin" && aiaction == "R")
{
if(mygame.myhand.numBettors == 0 && this.currentBet == 0)
{
faction = "bet";
}
else
{
faction = "raise";
}
if(faction == "raise" && this.numRaises >= _root.maxraises)
{
faction = "call";
}
if(mygame.myhand.AllInActive > 0)
{
faction = "allin";
}
}
if(aiaction == "C" && this.currentBet >= table["chipBox" + who].mybalance)
{
faction = "allin";
}
if(aiaction == "C" && faction != "allin")
{
if(mygame.myhand.currentBet == 0 || mygame.myhand.dealType[0] == "flop" && mygame.myhand.currentBet == bigblind && table["pBox" + who].mybet == bigblind)
{
faction = "check";
}
else
{
faction = "call";
}
if(this.AllInActive > 0)
{
if(random(3) == 0 || table["pBox" + who].mybet > mygame.myhand.currentBet)
{
faction = "allin";
}
else
{
faction = "fold";
}
}
}
if(aiaction == "F")
{
faction = "fold";
}
if(botsDoAll == true)
{
faction = "allin";
}
if(doodyhead == true)
{
faction = "fold";
}
trace("AI RESULT = " + faction + " ---- " + aiaction);
mygame.myhand.doBetAction(who,faction,aibet);
};
TheHand.prototype.doBetAction = function(who, action, aibet)
{
var _loc14_ = undefined;
mygame.mybubble.killBubble();
if(who == 3)
{
this.killBetButtons();
}
table["pBox" + who].highlite._visible = false;
switch(action)
{
case "allin":
var _loc5_ = undefined;
var _loc11_ = undefined;
this.AllInActive = this.AllInActive + 1;
if(table["pBox" + who].mybet > 0)
{
trace("AMT REMOVED FROM POT 0 " + table["pBox" + who].mybet);
this.potStore[0] -= table["pBox" + who].mybet;
}
amountToCall = this.currentBet - table["pBox" + who].mybet;
if(who == 3 && _root.attachNOchips == false)
{
var _loc12_ = arena.betBox.bal;
mygame.updateBalance(who,_loc12_,"pos");
}
_loc5_ = table["chipBox" + who].mybalance;
_loc11_ = _loc5_ + table["pBox" + who].mybet;
this.AllInPool[who] = _loc11_;
PlaySoundEffect("SOUND_CHIP3");
PlaySoundEffect("SOUND_ALLIN");
if(this.numBettors > 0)
{
this.numRaises = this.numRaises + 1;
}
this.numBettors = this.numBettors + 1;
if(this.currentBet < _loc5_)
{
this.currentBet = _loc5_;
}
table["pBox" + who].mybet = _loc5_;
mygame.mybubble.makeBubble(who,"All In ",_root.balanceFormat(_loc11_,0,","),3,1250);
table["pBox" + who].statusBox.display.text = "All In " + _root.balanceFormat(_loc11_,0,",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
mygame.updateBalance(who,_loc5_);
table["chipBox" + who]._visible = false;
if(this.AllInActive == 1)
{
this.potStore[1] = this.AllInPool[who];
this.currentpot = 1;
mygame.myhand.addToPot(_loc5_,0,true);
}
else if(this.AllInActive == 2)
{
var _loc9_ = true;
if(this.currentpot == 1)
{
this.currentpot = 2;
if(this.AllInPool[who] < this.potStore[1])
{
_loc9_ = false;
}
if(_loc9_ == true)
{
this.potStore[2] = this.AllInPool[who] - this.potStore[1];
this.potStore[1] *= 2;
this.currentpot = 2;
trace("BIGGER POT 1 = " + this.potStore[1]);
trace("POT 2 = " + this.potStore[2]);
trace("Aliin who = " + this.AllInPool[who]);
}
else
{
this.potStore[2] = this.potStore[1];
this.potStore[1] = this.AllInPool[who] * 2;
this.potStore[2] -= this.AllInPool[who];
trace("SMALL POT 1 = " + this.potStore[1]);
trace("POT 2 = " + this.potStore[2]);
trace("Aliin who = " + this.AllInPool[who]);
}
trace("Currentpot = " + this.currentpot);
}
else if(this.currentpot == 2)
{
if(this.AllInPool[who] <= this.potStore[1] / 2)
{
_loc9_ = false;
}
if(_loc9_ == false)
{
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.potStore[1];
this.potStore[1] = this.AllInPool[who] * 3;
this.potStore[2] -= this.AllInPool[who] * 2;
}
if(_loc9_ == true && this.AllInPool[who] < this.potStore[2] + this.potStore[1] / 2)
{
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.AllInPool[who] - this.potStore[1] / 2;
this.potStore[1] += this.potStore[1] / 2;
this.potStore[3] -= this.potStore[2];
this.potStore[2] += this.potStore[2];
}
else if(_loc9_ == true && this.AllInPool[who] >= this.potStore[2] + this.potStore[1] / 2)
{
this.potStore[3] = this.AllInPool[who] - this.potStore[2] - this.potStore[1] / 2;
this.potStore[1] += this.potStore[1] / 2;
this.potStore[2] += this.potStore[2];
}
this.currentpot = 3;
}
mygame.myhand.addToPot(_loc5_,0,true);
}
else if(this.AllInActive == 3)
{
trace("Currentpot = " + this.currentpot);
_loc9_ = true;
if(this.currentpot == 2)
{
if(this.AllInPool[who] <= this.potStore[1] / 2)
{
_loc9_ = false;
}
trace(_loc9_);
trace(this.AllInPool[who]);
trace(this.potStore[1]);
trace(this.potStore[2]);
trace("00000000000000000");
if(_loc9_ == false)
{
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.potStore[1];
this.potStore[1] = this.AllInPool[who] * 3;
this.potStore[2] -= this.AllInPool[who] * 2;
}
if(_loc9_ == true && this.AllInPool[who] < this.potStore[2] + this.potStore[1] / 2)
{
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.AllInPool[who] - this.potStore[1] / 2;
this.potStore[1] += this.potStore[1] / 2;
this.potStore[3] -= this.potStore[2];
this.potStore[2] += this.potStore[2];
}
else if(_loc9_ == true && this.AllInPool[who] >= this.potStore[2] + this.potStore[1] / 2)
{
this.potStore[3] = this.AllInPool[who] - this.potStore[2] - this.potStore[1] / 2;
this.potStore[1] += this.potStore[1] / 2;
this.potStore[2] += this.potStore[2];
}
this.currentpot = 3;
}
else if(this.currentpot == 3)
{
if(this.AllInPool[who] < this.potStore[1] / 3)
{
_loc9_ = false;
}
if(_loc9_ == false)
{
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.potStore[1];
this.potStore[1] = this.AllInPool[who] * 4;
this.potStore[2] -= this.AllInPool[who] * 3;
}
if(_loc9_ == true && this.AllInPool[who] < this.potStore[2] + this.potStore[1] / 3)
{
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.AllInPool[who] - this.potStore[1] / 3;
this.potStore[1] += this.potStore[1] / 3;
this.potStore[3] -= this.potStore[2] * 2;
this.potStore[2] *= 2;
_loc9_ = false;
}
else if(_loc9_ == true && this.AllInPool[who] < this.potStore[3] + this.potStore[2] / 2 + this.potStore[1] / 3)
{
this.potStore[3] = this.potStore[2];
this.potStore[2] += this.potStore[2] / 2;
this.potStore[1] += this.potStore[1] / 3;
this.potStore[3] = this.AllInPool[who] - this.potStore[1] / 3 - this.potStore[2] / 2;
this.potStore[3] += this.potStore[3];
_loc9_ = false;
}
else if(_loc9_ == true && this.AllInPool[who] >= this.potStore[3] + this.potStore[2] / 2 + this.potStore[1] / 3)
{
this.potStore[3] += this.potStore[3];
this.potStore[1] += this.potStore[1] / 3;
this.potStore[2] += this.potStore[2] / 2;
}
this.currentpot = 3;
}
mygame.myhand.addToPot(_loc5_,0,true);
}
else if(this.AllInActive == 4)
{
_loc9_ = true;
if(this.AllInPool[who] <= this.potStore[1] / 3)
{
_loc9_ = false;
}
if(_loc9_ == false)
{
trace("opt1");
this.potStore[4] = this.potStore[3];
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.potStore[1];
this.potStore[1] = this.AllInPool[who] * 4;
this.potStore[2] -= this.AllInPool[who] * 3;
}
if(_loc9_ == true && this.AllInPool[who] < this.potStore[2] / 2 + this.potStore[1] / 3)
{
trace("opt2");
this.potStore[4] = this.potStore[3];
this.potStore[3] = this.potStore[2];
this.potStore[2] = this.AllInPool[who] - this.potStore[1] / 3;
this.potStore[1] += this.potStore[1] / 3;
this.potStore[3] -= this.potStore[2] * 2;
this.potStore[2] *= 2;
_loc9_ = false;
}
else if(_loc9_ == true && this.AllInPool[who] < this.potStore[3] + this.potStore[2] / 2 + this.potStore[1] / 3)
{
trace("opt3");
this.potStore[4] = this.potStore[3];
this.potStore[3] = this.AllInPool[who] - this.potStore[1] / 3 - this.potStore[2] / 2;
this.potStore[2] += this.potStore[2] / 2;
this.potStore[1] += this.potStore[1] / 3;
this.potStore[4] -= this.potStore[3] * 2;
this.potStore[3] *= 2;
_loc9_ = false;
}
else if(_loc9_ == true && this.AllInPool[who] >= this.potStore[3] + this.potStore[2] / 2 + this.potStore[1] / 3)
{
trace("opt4");
this.potStore[4] = this.AllInPool[who] - this.potStore[1] / 3 - this.potStore[2] / 2 - this.potStore[3];
this.potStore[3] += this.potStore[3];
this.potStore[1] += this.potStore[1] / 3;
this.potStore[2] += this.potStore[2] / 2;
}
this.currentpot = 3;
mygame.myhand.addToPot(_loc5_,0,true);
}
trace("POTS ALERT *************");
trace(this.potStore[0]);
trace(this.potStore[1]);
trace(this.potStore[2]);
trace(this.potStore[3]);
trace(this.potStore[4]);
trace("POTS ALERT *************");
break;
case "raise":
var _loc6_ = undefined;
var amountToCall;
amountToCall = this.currentBet - table["pBox" + who].mybet;
if(who == 3)
{
_loc6_ = arena.betBox.bal - amountToCall;
}
else
{
_loc6_ = aibet;
}
_loc11_ = _loc6_ + amountToCall;
if(this.numBettors > 0)
{
this.numRaises = this.numRaises + 1;
}
this.numBettors = this.numBettors + 1;
this.currentBet += _loc6_;
table["pBox" + who].mybet += _loc11_;
PlaySoundEffect("SOUND_CHIP2");
if(amountToCall > 0)
{
mygame.mybubble.makeBubble(who,"I Call " + _root.balanceFormat(amountToCall,0,","),"& Raise " + _root.balanceFormat(_loc6_,0,","),3,1250);
}
else
{
mygame.mybubble.makeBubble(who,"I Raise " + _root.balanceFormat(_loc6_,0,","),"blank",3,1250);
}
table["pBox" + who].statusBox.display.text = "Raise " + _root.balanceFormat(_loc6_,0,",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
if(who != 3)
{
mygame.updateBalance(who,_loc11_);
}
if(this.AllInActive == 1)
{
this.potStore[1] += amountToCall;
this.potStore[2] = _loc6_;
this.currentpot = 2;
yup = true;
}
if(this.AllInActive == 2)
{
this.potStore[2] = amountToCall - this.potStore[1] / 2;
this.potStore[1] += this.potStore[1] / 2;
this.potStore[3] = _loc6_;
this.currentpot = 3;
yup = true;
}
if(this.AllInActive == 0)
{
mygame.myhand.addToPot(_loc11_,0);
}
else
{
mygame.myhand.addToPot(_loc11_,0,true);
}
break;
case "bet":
var _loc4_ = undefined;
if(who == 3)
{
_loc4_ = arena.betBox.bal;
}
else
{
_loc4_ = aibet;
}
this.numBettors = this.numBettors + 1;
PlaySoundEffect("SOUND_CHIP2");
this.currentBet = _loc4_;
table["pBox" + who].mybet = _loc4_;
mygame.mybubble.makeBubble(who,"I Bet ",_root.balanceFormat(_loc4_,0,","),3,1250);
table["pBox" + who].statusBox.display.text = "Bet " + _root.balanceFormat(_loc4_,0,",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
if(who != 3)
{
mygame.updateBalance(who,_loc4_);
}
mygame.myhand.addToPot(_loc4_);
break;
case "call":
_loc4_ = this.currentBet - table["pBox" + who].mybet;
PlaySoundEffect("SOUND_CHIP2");
table["pBox" + who].mybet += _loc4_;
mygame.mybubble.makeBubble(who,"I Call " + _root.balanceFormat(_loc4_,0,","),"blank",2,1250);
table["pBox" + who].statusBox.display.text = "Call " + _root.balanceFormat(_loc4_,0,",");
table["pBox" + who].statusBox.colorBox.gotoAndStop(2);
if(who == 3 && _root.attachNOchips == false)
{
_loc12_ = arena.betBox.bal - _loc4_;
trace(" ");
trace(" ");
trace("ADDING BACK TO MY BALANCE " + _loc12_);
trace(" ");
trace(" ");
mygame.updateBalance(who,_loc12_,"pos");
}
else
{
mygame.updateBalance(who,_loc4_);
}
if(this.AllInActive == 1)
{
this.potStore[1] += _loc4_;
yup = true;
}
if(this.AllInActive == 2)
{
this.potStore[2] = _loc4_ - this.potStore[1] / 2;
this.potStore[1] += this.potStore[1] / 2;
this.currentpot = 3;
yup = true;
}
if(this.AllInActive == 0)
{
mygame.myhand.addToPot(_loc4_,0);
}
else
{
mygame.myhand.addToPot(_loc4_,0,true);
}
break;
case "check":
mygame.mybubble.makeBubble(who,"Check","blank",2,1250);
table["pBox" + who].statusBox.display.text = "Check";
table["pBox" + who].statusBox.colorBox.gotoAndStop(2);
if(who == 3)
{
_loc12_ = arena.betBox.bal;
mygame.updateBalance(who,_loc12_,"pos");
}
break;
case "fold":
this.AllInPool[who] = 0;
PlaySoundEffect("SOUND_SPIN");
arena["card_" + who + "_0"]._visible = false;
arena["card_" + who + "_1"]._visible = false;
this.handPlayers[who] = "f";
table["pBox" + who].statusBox.display.text = "Folded";
table["pBox" + who].statusBox.colorBox.gotoAndStop(4);
if(who == 3 && _root.attachNOchips == false)
{
_loc12_ = arena.betBox.bal;
mygame.updateBalance(who,_loc12_,"pos");
}
table["pBox" + who].cover._visible = true;
}
if(who == 3)
{
arena.betBox.removeMovieClip();
ii = 0;
while(ii < table.chipBox3.chipcount + 1)
{
table["chipBox" + who]["chip" + ii].iButton.gotoAndStop(1);
ii++;
}
}
var _loc10_ = false;
var ii;
if(action == "call" || action == "fold" || action == "check")
{
if(this.betStart == this.betStop)
{
_loc10_ = true;
}
else
{
this.betStart = this.returnNextPlayer(this.betStart);
}
}
if(action == "raise" || action == "bet")
{
this.betStop = this.returnNextPlayer(this.betStart,"negative");
this.betStart = this.returnNextPlayer(this.betStart);
this.playOrder = this.getPlayOrder(this.betStart,this.handPlayers);
}
if(this.AllInActive > 0 && (action == "call" || action == "raise") && who == 3)
{
_loc10_ = false;
this.betStop = 3;
}
else if(action == "allin")
{
trace(this.AllInActive + " --- allinactive");
if(this.AllInActive < 2)
{
this.betStop = this.returnNextPlayer(this.betStart,"negative");
this.betStart = this.returnNextPlayer(this.betStart);
this.playOrder = this.getPlayOrder(this.betStart,this.handPlayers);
}
else if(this.betStart == this.betStop)
{
_loc10_ = true;
}
else
{
this.betStart = this.returnNextPlayer(this.betStart);
this.playOrder = this.getPlayOrder(this.betStart,this.handPlayers);
}
}
var _loc7_ = 0;
ii = 0;
while(ii < this.handPlayers.length)
{
if(this.handPlayers[ii] == "f" || this.handPlayers[ii] == "e")
{
_loc7_ = _loc7_ + 1;
}
ii++;
}
if(_loc7_ >= 4)
{
_loc10_ = true;
}
trace("BET START " + mygame.myhand.betStart);
trace("BET STOP " + mygame.myhand.betStop);
trace("PLAY ORDER " + this.playOrder + "\n");
if(_loc10_ == false)
{
this.gotoPlayer();
}
else
{
this.checkRoundStatus();
}
};
TheHand.prototype.checkRoundStatus = function()
{
function doComm2()
{
mygame.myhand.dealCommunityCards();
clearInterval(intID0009);
}
trace("checking round status");
var _loc4_ = 0;
var _loc6_ = undefined;
var _loc3_ = 0;
while(_loc3_ < this.handPlayers.length)
{
if(this.handPlayers[_loc3_] != "f" && this.handPlayers[_loc3_] != "e")
{
table["pBox" + this.handPlayers[_loc3_]].mybet = 0;
_loc4_ = _loc4_ + 1;
}
_loc3_ = _loc3_ + 1;
}
if(this.AllInActive > 1)
{
_loc4_ = 0;
}
if(_loc4_ >= 2 && this.dealType[0] != "end")
{
_loc6_ = 1500;
if(this.handPlayers[3] == "f")
{
_loc6_ = 500;
}
intID0009 = setInterval(doComm2,_loc6_);
}
else
{
trace("GETTING WINNER");
var _loc5_ = this.whosLeft();
if(_loc4_ == 1)
{
processHand(_loc5_[0]);
getWinner(_loc5_);
}
else
{
_root.attachMovie("runner","runner",1501);
}
}
};
TheHand.prototype.whosLeft = function()
{
var _loc3_ = new Array();
var _loc2_ = 0;
while(_loc2_ < this.handPlayers.length)
{
if(this.handPlayers[_loc2_] != "f" && this.handPlayers[_loc2_] != "e")
{
_loc3_.push(_loc2_);
}
_loc2_ = _loc2_ + 1;
}
return _loc3_;
};
TheHand.prototype.startBetting = function()
{
this.numBettors = 0;
this.numRaises = 0;
this.betStop = this.returnNextPlayer(this.dealerSlot);
this.betStop = this.returnNextPlayer(this.betStop);
this.playOrder = this.getPlayOrder(this.betStop,this.handPlayers);
trace("BET START " + mygame.myhand.betStart);
trace("BET STOP " + mygame.myhand.betStop);
trace("PLAY ORDER " + this.playOrder + "\n");
this.gotoPlayer();
};
TheHand.prototype.keepBetting = function()
{
this.numBettors = 0;
this.numRaises = 0;
this.currentBet = 0;
this.betStart = this.returnNextPlayer(this.dealerSlot);
if(this.handPlayers[this.dealerSlot] != "e" && this.handPlayers[this.dealerSlot] != "f")
{
this.betStop = this.dealerSlot;
}
else
{
this.betStop = this.returnNextPlayer(this.dealerSlot,"negative");
}
this.playOrder = this.getPlayOrder(this.betStart,this.handPlayers);
trace("BET START " + mygame.myhand.betStart);
trace("BET STOP " + mygame.myhand.betStop);
trace("PLAY ORDER " + this.playOrder + "\n");
this.gotoPlayer();
};
TheHand.prototype.returnNextPlayer = function(slot, type)
{
var _loc2_ = undefined;
var _loc3_ = slot;
var _loc4_ = true;
while(this.handPlayers[_loc2_] == "f" || _loc4_ == true || this.handPlayers[_loc2_] == "e")
{
_loc4_ = false;
if(type != "negative")
{
_loc2_ = _loc3_ + 1;
if(_loc2_ == this.handPlayers.length)
{
_loc2_ = 0;
}
if(this.handPlayers[_loc2_] == "f" || this.handPlayers[_loc2_] == "e")
{
_loc3_ = _loc3_ + 1;
if(_loc3_ == this.handPlayers.length)
{
_loc3_ = 0;
}
}
}
else
{
_loc2_ = _loc3_ - 1;
if(_loc2_ < 0)
{
_loc2_ = this.handPlayers.length - 1;
}
if(this.handPlayers[_loc2_] == "f" || this.handPlayers[_loc2_] == "e")
{
_loc3_ = _loc3_ - 1;
if(_loc3_ < 0)
{
_loc3_ = this.handPlayers.length;
}
}
}
if(_loc3_ == 25 || _loc3_ < -25)
{
this.handPlayers[_loc2_] = 4;
}
}
return _loc2_;
};
TheHand.prototype.getPlayOrder = function(d, hp)
{
var _loc6_ = new Array();
var _loc3_ = 0;
var _loc5_ = undefined;
_loc5_ = d + 1;
if(_loc5_ == 5)
{
_loc5_ = 0;
}
if(hp[_loc5_] == "e" || hp[_loc5_] == "f")
{
_loc5_ = this.gpoFix(_loc5_,hp);
}
var _loc4_ = 0;
while(_loc4_ < hp.length)
{
if(hp[_loc5_] == hp[_loc4_])
{
_loc3_ = _loc4_;
break;
}
_loc4_ = _loc4_ + 1;
}
if(_loc3_ >= hp.length)
{
_loc3_ = 0;
}
_loc4_ = 0;
while(_loc4_ < hp.length)
{
if(hp[_loc3_] != "f" && hp[_loc3_] != "e")
{
_loc6_.push(hp[_loc3_]);
}
_loc3_ = _loc3_ + 1;
if(_loc3_ >= hp.length)
{
_loc3_ = 0;
}
_loc4_ = _loc4_ + 1;
}
return _loc6_;
};
TheHand.prototype.gpoFix = function(c, ar)
{
var _loc5_ = undefined;
var _loc1_ = c;
var _loc2_ = true;
while(ar[_loc1_] == "e" || ar[_loc1_] == "f" || _loc2_ == true)
{
_loc2_ = false;
_loc1_ = _loc1_ + 1;
if(_loc1_ == 5)
{
_loc1_ = 0;
}
}
return _loc1_;
};
TheHand.prototype.getRank = function()
{
this.aR = new Array();
var _loc2_ = 0;
while(_loc2_ < 5)
{
if(_loc2_ != 2)
{
if(table["chipBox" + _loc2_].mybalance > 0 && table["chipBox" + _loc2_].mybalance != undefined)
{
this.aR.push({amt:table["chipBox" + _loc2_].mybalance,n:table["pBox" + _loc2_].myname.text,place:"0"});
}
else if(table["pBox" + _loc2_].myname.text != "")
{
this.aR.push({amt:0,n:table["pBox" + _loc2_].myname.text,place:table["pBox" + _loc2_].rank});
}
}
_loc2_ = _loc2_ + 1;
}
this.aR.sortOn("place",18);
this.aR.sortOn("amt",18);
return this.aR;
};
TheHand.prototype.getStandings = function(action)
{
arena.attachMovie("standings","standings",this.mydepth++);
if(action == "win")
{
arena.standings.gotoAndStop(2);
}
else if(action == "lose")
{
arena.standings.gotoAndStop(3);
}
else if(action == "expired")
{
arena.standings.gotoAndStop(4);
}
else if(action == "maxed")
{
arena.standings.gotoAndStop(5);
arena.standing.msg1.text = "This web version has a " + maxHandsAllowed + " hand limit per Round";
arena.standing.msg2.text = "This web version has a " + maxHandsAllowed + " hand limit per Round";
arena.standing.msg3.text = "This web version has a " + maxHandsAllowed + " hand limit per Round";
}
if(action == "win" || action == "lose" || action == "expired" || action == "maxed")
{
finalscore = table.chipBox3.mybalance;
if(finalscore == undefined)
{
finalscore = 0;
}
totalTimePlayed = Math.floor((getTimer() - ntrecord) / 1000) * 0.01;
if(totalTimePlayed < 0.5)
{
totalTimePlayed = 0.5;
}
trace("ttp = " + totalTimePlayed);
trace("nhrec = " + nhrecord);
trace("finalscore = " + finalscore);
powerranking = Math.floor(finalscore / nhrecord / totalTimePlayed);
arena.standings.powerranking = powerranking;
mygame.mybubble.killBubble();
arena.standings.btn_okay._visible = false;
arena.standings.btn_playagain._visible = true;
arena.standings.btn_download._visible = true;
PlayMusic("MUSIC_INTRO",_root.volM);
arena.standings.btn_playagain.btn.onRelease = function()
{
_root.killTheGame("new");
arena.standings.removeMovieClip();
};
arena.standings.btn_mainmenu.btn.onRelease = function()
{
_root.killTheGame();
arena.standings.removeMovieClip();
};
arena.standings.btn_download.btn.onRelease = function()
{
trace("download pressed");
_root.downloadAction();
};
if(_global.noZoneAPI != true)
{
_root.DoGameEnd();
}
if(_global.realmode == true)
{
arena.standings.btn_download._visible = false;
arena.standings.btn_mainmenu._x += 60;
arena.standings.btn_playagain._x += 60;
}
}
else
{
arena.standings.btn_okay._visible = true;
arena.standings.btn_playagain._visible = false;
arena.standings.btn_mainmenu._visible = false;
arena.standings.btn_download._visible = false;
arena.standings.btn_okay.btn.onRelease = function()
{
arena.standings.removeMovieClip();
};
}
arena.standings.btn_okay.btn.onPress = function()
{
_root.buttonSound();
};
myrank = this.getRank();
var _loc4_ = 0;
while(_loc4_ < myrank.length)
{
arena.standings["p" + _loc4_].text = myrank[_loc4_].n;
if(myrank[_loc4_].amt > 0)
{
arena.standings["score" + _loc4_].text = balanceFormat(myrank[_loc4_].amt,0,",");
}
else
{
arena.standings["score" + _loc4_].text = myrank[_loc4_].place;
}
trace(arena.standings["p" + _loc4_].text);
if(arena.standings["p" + _loc4_].text == undefined || arena.standings["p" + _loc4_].text == "undefined")
{
arena.standings["p" + _loc4_].text = " ";
arena.standings["score" + _loc4_].text = " ";
}
_loc4_ = _loc4_ + 1;
}
var _loc5_ = 4;
_loc4_ = mygame.elimPlayers.length - 1;
while(_loc4_ > -1)
{
arena.standings["p" + _loc5_].text = mygame.elimPlayers[_loc4_].name;
arena.standings["score" + _loc5_].text = mygame.elimPlayers[_loc4_].place;
_loc5_ = _loc5_ - 1;
_loc4_ = _loc4_ - 1;
}
};
killHand = function(who)
{
arena.potBox.removeMovieClip();
};
initLoader();
myr = 0;
stop();